Git Commands That I Love

Git commands that I use often at work. Helpful for people who are working in teams and want to avoid merge conflict.

Intro

Do you learn better with hands-on experience? Or do you learn better by reading? Or are you both? Let me be honest with you all, I learn better with hands-on experience. I have read dozens and dozens of Git-related articles, but I couldn’t grasp the concept well until I actually had to use these commands MYSELF. So I suggest you to open up your terminal or your VS code and get ready to these commands TO WORK! I would also attach a small guide on how to use these commands, so it’s easier for you to grasp the concept after reading each section. Alright, let’s cut to the chase!

Git Commands I Love

  1. git commit -am "message here"
  • You simply want to know which files you have made changes on.
  • You don’t want to commit all the changes you’ve made, especially working in teams. You may want to save some for only local use, and/or to avoid merge conflict later in projects, or;
  • There are newly created files that requires tracking remotely you might not be aware of.
  • Create a new file and try the command and see what it displays.
  • Make some changes in one of your existing files and compare the difference.

Special Mentions

I originally posted the shorter version of this on my LinkedIn.

  1. git rebase vs git pull --rebase
  2. git add -p
  3. brew install tig
  4. git ignore
  5. git diff
  6. git rebase — onto
  7. git gui

Epilogue

Hope you enjoy this article! A few Git commands might be already a lot to take in, but practice whenever you remember or when you have a chance. I have hit the wall multiple times and had a lot of errors yelling at me until I remembered. Git can be annoying to some people, but honestly, please have some patience with it and read the errors. You will get a hang of it eventually!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store