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.

[flashvideo filename=”video/02-git.flv” width=”480″ height=”360″ /]

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:

. 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:

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.

Published by

Michael Marner

My name is Michael, and this is my website. I am currently working as a Research Fellow at the University of South Australia's Wearable Computer Lab. I am also the chair of the board and an announcer at Adelaide based community radio station Three D Radio 93.7FM.

7 thoughts on “Git Tutorial 02 – The basics”

  1. Maybe I’m being dense, but suppose I setup several projects in Git, each in a different directory, how do I switch between them?

  2. 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.

  3. commit -a -m “comment”

    Any reason not to use the commit -a -m format instead of making a trip to the editor?

  4. 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.

  5. These are good videos, however a similar set of videos aimed at people who haven’t used version control before would be great.

    all you need to change really is don’t make any comparisons to other version control systems. and possibly demonstrate all these actions with nautilus-rabbitvcs

Leave a Reply

Your email address will not be published. Required fields are marked *