cheltenham geeks - git talk/interactive session

23
git commit -m “Cheltenham Geeks” Introduction to version control using git

Upload: matt-breckon

Post on 06-May-2015

106 views

Category:

Technology


2 download

DESCRIPTION

Presentation about the git source control system given to the Cheltenham Geeks group. This formed part of a longer interactive session in which the group followed along.

TRANSCRIPT

Page 1: Cheltenham Geeks - git talk/interactive session

git commit -m “Cheltenham Geeks”

Introduction to version control using git

Page 2: Cheltenham Geeks - git talk/interactive session
Page 3: Cheltenham Geeks - git talk/interactive session

Getting started

• git --version

• git --help

• git <command> --help

Page 4: Cheltenham Geeks - git talk/interactive session

Configuration

• git config --global user.name "bob"

• git config --global user.email [email protected]

• git config --global core.editor vi

• git config --global color.ui true

Page 5: Cheltenham Geeks - git talk/interactive session

Staging

Repository Stage Working Copy

add / rmcommit

checkout

Page 6: Cheltenham Geeks - git talk/interactive session

After first commit on branch

Initial commit

Branch commit

master

branch

Page 7: Cheltenham Geeks - git talk/interactive session

After commit on master

Initial commit

master branch

Page 8: Cheltenham Geeks - git talk/interactive session

What is HEAD in git?

Initial commit

master branch

HEAD After "git checkout master"

Page 9: Cheltenham Geeks - git talk/interactive session

What is HEAD in git?

Initial commit

master branch

HEADAfter "git checkout branch"

Page 10: Cheltenham Geeks - git talk/interactive session

After merge from branch

Initial commit

master branch

Page 11: Cheltenham Geeks - git talk/interactive session

After deleting branch

Initial commit

master

Page 12: Cheltenham Geeks - git talk/interactive session

Fast forward merges

Initial commit

Branch commit

master

branch Branch commit

Page 13: Cheltenham Geeks - git talk/interactive session

Fast forward merges

Initial commit

Branch commit

master

branchBranch commit

Page 14: Cheltenham Geeks - git talk/interactive session

Rebase vs Merge

Initial commit

master branch

Page 15: Cheltenham Geeks - git talk/interactive session

Rebase

Initial commit

master branch

patch re-applied

Page 16: Cheltenham Geeks - git talk/interactive session

Rebase

Initial commit

master branch

Page 17: Cheltenham Geeks - git talk/interactive session

Branching in centralised version control systems• This is an example from my current work project (using TFS)

• release

• release 0.1.0.0

• branch

• asteroid

• sputnik

• meteor

• cosmicdebris

• main

• Making and maintaining branches is expensive so they are created and setup and never changed

Page 18: Cheltenham Geeks - git talk/interactive session

Branching in git

• Branching is fast

• Switching between branches is fast

• Branches can be thrown away easily

• Different workflows are possible

• Create, work on, merge, delete many branches in a single day

Page 19: Cheltenham Geeks - git talk/interactive session

Distributed Version Control

Source: Eric Sink’s Version Control by Example

Page 20: Cheltenham Geeks - git talk/interactive session

Distributed version control

• Integration manager workflow

Source: Pro Git (Scott Charon)

Page 21: Cheltenham Geeks - git talk/interactive session

Distributed version control

• Dictator and lieutenant workflow

Source: Pro Git (Scott Charon)

Page 22: Cheltenham Geeks - git talk/interactive session

Other topics

• Git hooks

• Stashing

• Patches

Page 23: Cheltenham Geeks - git talk/interactive session

Further reading

• Version Control By Example (Eric Sink)

• http://www.ericsink.com/vcbe/html/index.html

• Pro Git (Scott Chacon)

• http://git-scm.com/book