DEV Community

Cover image for 42 Git Questions Answered

42 Git Questions Answered

Jason McCreary on October 17, 2019

What is your favorite Git command? I am a sucker for git add -p. This adds changes in "patch mode" which is a built-in command line program. It...
Collapse
 
mohsenoid profile image
Mohsen Mirhoseini

Nice job!
At last, what is your answer to the very famous philosophical question of "Shall we use Merge or Rebase?!" 😁

Collapse
 
kdraypole profile image
Kobe Raypole

Great stuff. I also recommend most people learn to work with git from the command line. In my experience, GUI versions of git can often confuse new developers. Learning git at its core can help you work from any development experience.

Collapse
 
mmirca profile image
mmirca

Great post! For number 11 git clean might get the job done: git-scm.com/docs/git-clean

Collapse
 
gonedark profile image
Jason McCreary

For sure. Good point, I'll add that as an option.

Collapse
 
liminal profile image
Karl Åström

I would suggest you should never use --force, instead if you need that functionality use --force-with-lease which requires your remote tracking refs to be up to date

Collapse
 
gonedark profile image
Jason McCreary

Good one. I'll read up more on that and maybe do a follow-up post.

Collapse
 
gonedark profile image
Jason McCreary

Absolutely. Some things are definitely easier with the GUI. Especially when visual. It's good to understand though how Git marks these conflicts though so you could do it manually.