Using Git can be the easiest yet most frustrating part of becoming a developer. It’s as simple as a quick tutorial to get into, yet I promise it will take a long time to perfect. But Git is a need to know for every coder. Check out this great tutorial that breaks down mastering the art of Git.
How to master the art of Git by Adnan Rahić
Make it a habit!
Adnan offers some simple TLDR; steps for learning Git through habit:
-
git status
all the time! -
Try only to change files you really want to change.
-
git add -A
is your friend.
Note from me: Seriously it is! I've gotten in a nasty habit of just doing `git add .`, adding all of my files to a commit everytime instead of just the specific one I'm changing. This can create waves of issues if you are editing multiple files at the same time!
- Feel free to
git commit -m "meaningful messages"
.
Another note from me: Again, seriously, meaningful messages! It's easy to just write whatever (literally, I find myself writing `whatever` a lot) to get the commit saved. But that won't help down the line when you need to remember what you've just screwed up ;)
-
Always
git pull
before doing any pushing, but after you have committed any changes. -
Finally,
git push
the committed changes.