The Only Four Git Commands You Need (To Get Started)

Travis Waith-Mair
Non-Traditional Dev
5 min readSep 3, 2020

--

Photo by sarandy westfall on Unsplash

Source control is one of the most important tools you can learn when becoming a developer. Source control is used for many things. It’s used to keep a history of your code. It is used as a collaboration tool for team members working on the same code base. More and more, it has become the standard way to trigger automated code integration and deployment. Though there are several source control tools out there, Git has become the defacto standard.

Despite this, Git can be intimidating, especially for new developers. Luckily, Just like how you can get by very well only learning the most common words in a spoken language, you can be very successful at Git with just four commands.

How Does Git Work

The best way to understand git is to think of a stack of photos. Each photo represents a moment in history. The top photo is the most recent snapshot and to go look at previous snapshots, you have to take off the photos to get to it.

Git, more or less, works the same way. It is a series of snapshots called commits that show what your code looked like at any given point. You can use Git to travel through time and see what your code looked like at any given snapshot and even compare any two snapshots together and see how they differ, which is called getting a dif of the two…

--

--