Basics of Using Git from the Command Line
I was looking for the shortest tutorial on the basics of using Git from the command line. This one, Git Tutorial 4: Basic Commands: add, commit, push from YouTube was pretty good.
Here are some notes I made from watching that video:
- The
git status
command will show you files and folders that have changes. It also shows you files that you've already committed into your local repository, but haven't pushed yet into a remote server. - The
git add
command adds files that have changes into a staging area on your local computer. - The
git commit
command will commit those changes into your local repository. Emphasis on local. At this point your changes are not saved to a remote server like Github just yet. The committed changes are still on your local Git repository. - The
git push
command is the one that will send your changes up to your remote Github repository.
This next tip is not something I learned from the video, but from someplace else that I don't remember.
- To get out of a long results screen from using the
git log
command, you can typeq
.
Tags: #Git
Discuss... or leave a comment below.