I was recently talking to a longtime friend of mine who works in Silicon Valley and I was astonished to learn that many developers don’t actually know how to use Git from the command line. I know there are a couple of tools out there like Tower that are supposed to make things easier, but I find them sort of complicated actually. I bought a Tower license around 2 years ago and probably have used the app maybe 3 times. If anything, I use the Git integration built into Android Studio, but most of the time I’m using Git from the command line, and you should too. Most if not all Macs and Linux machines should come with Git already installed, if you don’t have it go ahead and install it here.

Prerequisites: A computer with Git installed, basic knowledge of Git, and basic knowledge of Unix commands

I have organized this tutorial by first stating what I want to do, and following that with a code example.


Notes: This initializes the current directory to begin tracking changes with Git.

Notes: Per standard unix syntax, you can add all files in the current directory with git add .. Also, remember to perform a git add after making changes each time before committing.

Notes: This will show all files that have been changed, added, or deleted.

Notes: -m "changed fonts and colors" is an optional comment.

Notes: r39j145 is the first 7 characters of the commit number. -b stands for branch.

7. I want to use GitHub from my terminal
Set up GitHub from to be used from the terminal here.

Notes: git@github.com:MalcolmMcFly/DineMob-Web.git is the SSH path of a project on GitHub.

Notes: dev is the branch name.

Notes: dev is the branch name.

Notes: Here mergetool which launch and let you choose which version of the file is correct. The mergetool will created a .orig appended copy of the file conflict file for you view how it looked originally before the merge; you may delete this file. Always perform a git commit after resolving merge conflicts.