Git Tutorial 02 – The basics
This video hits up the terminal and starts using git. We start by creating a git repository, which is super easy with Git. Then, we look at adding files to the repository, and commiting changes.
Note that this video is 640×480, so hit the full screen button to get more readable detail.
Notes
In this video, I specifically create a project using:
git init
. If you are working on your own projects, this is how you will work. However, a lot of the time you will be starting work on an already existing project. In this case, you don’t create a new repo using git init, instead you clone an already existing repository. The basic is this:
git clone path/to/repository
I will cover this in a later video, but I think it is important enough to mention here.
Another thing that I could have covered in more detail is the staging area. There is actually a lot more that you can do with it than I mentioned in this video. However, that will come later. For the first 3 videos (at least) I want to just get the basics down.

December 26th, 2009 at 5:17 pm
thanks dude, i get it now
awesome tuts
July 9th, 2010 at 4:08 am
Maybe I’m being dense, but suppose I setup several projects in Git, each in a different directory, how do I switch between them?
July 9th, 2010 at 12:02 pm
When you create a project in Git (either with a git init or a git cone), Git will put a hidden folder into the project’s directory (called .git). In this folder are all the settings and stored objects for that project.
Whenever you type a command (such as git status or git log), git will look for the .git folder in the current directory, or work its way through parent directories until it finds it.
Therefore, you don’t have to do anything to switch projects, other than to cd into the correct directory. Git will use whatever repo (.git folder) it finds first.
July 10th, 2010 at 9:55 am
commit -a -m “comment”
Any reason not to use the commit -a -m format instead of making a trip to the editor?
July 15th, 2010 at 10:16 am
Sometimes (such as for the initial commit), the commit message is not so important. Putting the commit message on the command line is just a shortcut; it makes no difference as far as git is concerned.