Basic Git commands

John John (304)
0

There are some fundamental git commands that you will use frequently that are hard to work into a "how-to" guide. Here are some basic git commands and how to use them. These are in no specific order.

git×1

Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.

git branch -v will show you all of your local branches, their commit messages, and which branch is checked out.

git status will show you the status of the branch you currently have checked out. Before you switch branches, merge, pull or push you want to make sure you have a clean working directory and you can check with git status.

git checkout -b branch_name will create a branch from the branch you currently have checked out, and it will be called "branch_name" or whatever you'd like to call it.

git add . is a useful command that will version control any new files and remove from version control any files that you've deleted. If you have a file that has been added to git that you have deleted from your repository, it won't be deleted from git until you use git add ..

Taking control of your Pi is easy!
Ash Ash (362)
0

Learning how to navigate your Raspberry Pi can be tricky—but it doesn't have to be! We've comprised a list of the most common Raspberry Pi commands. Not sure where to start?