24
Version Control & Git Geoff Ford & Craig Smith Suncorp

Version Control & Git

Embed Size (px)

DESCRIPTION

A brief refresher of version control and an overview of Distributed Version Control and Git.

Citation preview

Page 1: Version Control & Git

Version Control & Git

Geoff Ford & Craig Smith

Suncorp

Page 2: Version Control & Git

According to Wikipedia:

“… is the management of changes to documents, programs, and other information stored as computer files.”

Image: http://i.ehow.com/images/GlobalPhoto/Articles/2065416/dictionary_Full.jpg

Page 3: Version Control & Git

Before Version Control

File renamingCode.001CodeNov1.xml

Directories\Nov1Code

Zip filesNov1Code.zip

Nothing at all Image: http://www.stud.u-szeged.hu/Sajben.Emma/TW1128-Rock-Stars.jpg

Page 4: Version Control & Git

We have moved on…

haven’t we?

Image http://yabadabadoo.files.wordpress.com/2008/03/puzzled-fred.jpg

Page 5: Version Control & Git

•diff

•SCCS1970’s

•RVS

•CVS1980’s Tool

Support1990’s

DVCS (Bitkeeper,Git, etc…)

2000’s

A Brief History

Image http://www.free-background-wallpaper.com/images/Wallpapers1280/Beach-Wallpaper/Sand-Dunes-Soft.jpg

Page 6: Version Control & Git

Version Control is…

Backup & restore

Synchronisation

Undo

Track changes

Sandbox / spike

Branch / merge

Not just for code

Image http://globalnerdy.com/wordpress/wp-content/uploads/2007/10/version_control_star_trek_style.jpg

Page 7: Version Control & Git

Check-in&

Check-out

Page 8: Version Control & Git

Branching&

Merging

Page 9: Version Control & Git

SubversionSetup

Image http://blog.daemon.com.au/images/SourceImage/svnstructure.jpg

Page 10: Version Control & Git

Version Control Best Practice

Use good comments

Commit often

Single vs multi project repos

Branch/tag when appropriate

Binaries/large files

Respect the trunk

Get to know your command line & client

Image http://www.improvizations.com/Portals/42614/images//best-

practice%20checklist-resized-600.jpg

Page 11: Version Control & Git

• d

Visualisation: FishEye/SVNStat

Page 12: Version Control & Git

Traditonal / Centralised

Version Control

Page 13: Version Control & Git

Distributed Version Control

Page 14: Version Control & Git

Hybrid Model

Version Control

Page 15: Version Control & Git

Why Distributed Version Control?

Cheap local branches for easy experimenting

History aware merges

Full local history

Offline commits

Each working copy is a complete backup of the repository

Page 16: Version Control & Git

Example DistributedVersion Control

Tools

Git (2005)http://git-scm.com

Mercurial (2005)http://mercurial.selenic.com

Bazaar (2005)http://bazaar-vcs.org

Darcs (2004)http://darcs.net

Page 17: Version Control & Git

Git is Fast

Page 18: Version Control & Git

Git is Efficient

Page 19: Version Control & Git

git clone git://example.com/repo.git

Clone

Git Workflow

git checkout -b new-feature

Working Branch

git add .

git commit -m “Commit Message”

Commit

git rebase master

git checkout master

git merge new-feature

Rebase & Merge

git push origin

Push

Page 20: Version Control & Git

git svn clone http://example.com/repo

Clone

Git + SVN Workflow

git checkout -b new-feature

Working Branch

git add .

git commit -m “Commit Message”

Commit

git rebase master

git checkout master

git merge new-feature

Rebase & Merge

git dcommit

Push to SVN

Page 21: Version Control & Git

Repository Many Branches

Page 22: Version Control & Git

Many Branches + Merges

Page 23: Version Control & Git

LiveDemo

Page 24: Version Control & Git

Want More Information?Geoff [email protected]

Craig [email protected]

References:

http://www.spearce.org/2007/07/difficult-gitk-graphs.html

http://www.infoq.com/articles/dvcs-guide http://ldn.linuxfoundation.org/article/dvcs-round-one-

system-rule-them-all-part-3 http://gaveen.owain.org/2008/05/simple-diagram-on-

distributed-vcs-hint.html http://betterexplained.com/articles/a-visual-guide-to-

version-control/ http://en.wikipedia.org/wiki/Revision_control