This is a 10 minute introduction to git. It has a very specific goal: to teach one enough to use git to store the revisions to their own projects. It does not cover sharing repositories, using someone else's repository, branching, or any number of advanced features. Furthermore, this is more of an introduction to version control rather than something specific to git. It emphasizes operations that can be done with any version control system.

This is designed to be a part of an oral presentation, thus does not necessarily stand on its own. It should serve as notes for after that presentation for further research and reading. If you are reading this on your own, you will have to do more reading to understand things here.

Keep in mind: I can't teach you git, but I can give you ideas and your curiosity can teach you git.


After completing this tutorial, you should be able to:


The tutorial

Before starting, run these commands

git config --global "Your Name"
git config --global
git config --global color.ui auto

These set some standard global options for your user - your name, and making output colorful.

What is history?

To view history, run:

git log
git log --oneline

Where is this history stored / what is a git repository?


Adding initial files

Making your first commit


Regular work flow

This is what you do on normal working days:

Getting information

How does this work in practice?


Next steps

Here are some ideas for independent study that you need to try yourself:

Regarding git add: I did not talk about the index (also known as staging). This is everything related to the command git add. Most tutorial and example usages of git talk about this extensivly. Basically, instead of running git commit FILENAME, people will run

git add FILENAME
git commit

so there is another step in there. This is conceptually advantageous, but for now is an extra complication (and I hardly ever use it). Just be aware that other tutorials will talk about git add, and eventually knowing about "the index" will be a little bit useful.

DebianNotes/git/10MinuteGit (last edited 2014-04-27 17:13:31 by RichardDarst)