Member-only story

Overview of the most frequently used Git commands, Part I: Main branch only

Alonso Del Arte
13 min readAug 8, 2024

--

Photo by Campbell on Unsplash

Depending on how you count these things, Git has more than a hundred commands. Most programmers only need four or five on a daily basis.

Even so, this article turned out so long I had to split it into two parts. In this part, I will cover all the most commonly used commands except the commands for creating branches and switching between branches.

The most frequently used Git command is Git Status. Or it ought to be. Because whenever you think you know exactly what state your repository is in, you’re probably wrong.

Before you can use git status, you need to navigate your terminal or command prompt to a folder where you have a local Git repository. For this article, I assume you already have Git installed on your local computer and you have access to the command line.

For a quick refresher on the command line, see my articles on the subject. I wrote one about the DOS-like command prompt in Microsoft Windows and one about the Terminal in macOS. I don’t have one of those for Linux.

You can either initialize a brand new local Git repository with the Git Initialize command or copy from a remote Git repository with the Git Clone command.

--

--

Alonso Del Arte
Alonso Del Arte

Written by Alonso Del Arte

is a Java and Scala developer from Detroit, Michigan. AWS Cloud Practitioner Foundational certified

No responses yet