Git is an SCM system.

Not centralized like many other SCM systems - most operations happen locally


Tell it who you are

Make a repository.

Some basic commands

git add <file>

To stage changes means to add them to the index or cache or 'staging area'

git commit

A commit is a record of changes to a repository

tracked/untracked files - states

See what state a file is in using 'git status' - won't show ignored

Making changes

'--cached' shows diff between HEAD and index, without it, we see modified files

Le commit

Changing anything will lead to different hash; different commit

Commit message guidelines

Capitalized, short (50 chars or less) summary

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. Leave blank line between summary (first line) & body.

Body can be many detailed paragraphs long. Bullet points are also
acceptable, using either - or *. Also, don't end summary with a

Part two

Working with branches.

One of the Git's killer features. Easy and efficient.

Some terms & commands

Why branch

Bad ideas; Fedora package collection; github/gitorious

Create a branch and 'check it out'

Work just like before, only changes here won't be reflected in existing branch

Merging branches


Merge Conflicts

Merge conflicts usually happen when 2 branches are being merged which have overlapping changes

Options when conflicts happen


A rebase is like a merge, except it tries to keep things cleaner so the history is more linear.


Conflicts/problems during a rebase


Don't use rebase if you've already pushed commits that it will change.

Part three

Working with remotes.

Git on the internet.

Some free Git repository hosting

Putting stuff into a remote repo: pushing

Getting stuff from a remote repo

Advantages of remote repositories

Other useful commands to try

Places to get help/tips