DEV Community

Discussion on: 20 Git Commands Every Developer Should Know

Collapse
 
banesto profile image
Ernests Kečko • Edited

There's a certain distinction between "should now" and "use regularly", at least for me as I switched to GUI tool for better representation of git tree.

On regular basis, I use only these commands:

  • git rebase -i - most used command to amend whole branch (remove commits, edit commit message and many more)
  • git reset HEAD^1 - to get code back last commit changes into working tree and continue working - as a development strategy doing backup and WIP commit
  • git branch --contains <hash> - to check in which branches given commit is included (really helps if there are lots of staging/demo branches apart from master branch)
  • git log -G<string> --all - use lots of time to search code in git history

Also, if you're making a list of commands one should know, this list certainly is missing a git diff command.

Cheers!

Collapse
 
krishnaagarwal profile image
Krishna Agarwal

Added in the post.
Sorry and Thanks

Collapse
 
banesto profile image
Ernests Kečko

Nothing to be sorry about! Cheers!

Thread Thread
 
krishnaagarwal profile image
Krishna Agarwal

Thanks 💯