Slide 1

Slide 1 text

git

Slide 2

Slide 2 text

What is git? ● Version control system ● Works well with text files - programs, LaTeX, beamer ● Created by Linus

Slide 3

Slide 3 text

git terminology ● Repository = Collection of files + change history ● commit = Action of changing repo state ● clone = Making a copy of a repo ● Remote repository = Repo in another location ○ push = Push changes in local repo to a remote repo ○ pull = Pull changes in a remote repo to a local repo ● Merging = Reconciling conflicting changes

Slide 4

Slide 4 text

Creating a repository ● git init ● Demo

Slide 5

Slide 5 text

Checking repository status ● git status ● Demo

Slide 6

Slide 6 text

Committing to a repository ● Two step procedure ○ git add ○ git commit ● Demo Repository Unstaged changes Staging Area git add git commit

Slide 7

Slide 7 text

Viewing commit history ● git log ● gitk ● Demo

Slide 8

Slide 8 text

Configuring user details ● git config --global user.name “Name” ● git config --global user.email “Email” ● Demo

Slide 9

Slide 9 text

Storing a repository on the cloud ● Create a repo on www.bitbucket.org ● cd /path/to/my/local/repo ● git remote add origin ● git push -u origin --all

Slide 10

Slide 10 text

Cloning a repository ● git clone ● Demo

Slide 11

Slide 11 text

Pushing to a remote repository ● git push ● Demo

Slide 12

Slide 12 text

Pulling from a remote repository ● git pull ● Demo

Slide 13

Slide 13 text

Handling conflicting changes ● Demo

Slide 14

Slide 14 text

Further Reading http://git-scm.com/book