Version Control The task of keeping a software system consisting of many versions and configurations well organized. source: http://dictionary.reference.com/browse/version control Wednesday, February 20, 13
Why use It? • It’s a communication tool • You can safely share code • Your development is organized • Changes are tracked • Prevents overwriting past work Wednesday, February 20, 13
Repository A code database used to enable the collaborative development of large projects by multiple engineers. source: http://www.termwiki.com/EN:SCM_repository Wednesday, February 20, 13
Check-out The act of copying the latest revision of a file from the repository so that it can be modified. source: http://www.termwiki.com/EN:check_out Wednesday, February 20, 13
Check-in The act of copying files back into the repository after changing them. Also known as a commit. source: http://www.termwiki.com/EN:check_in Wednesday, February 20, 13
Shared repos • Facilitates sharing • Typically, no local changes • Has been turned into a great web service (e.g. Github & Bitbucket) • Ultimately, not needed Wednesday, February 20, 13
getting git • It’s FREE • Included in OSX (needs upgraded) • Download from http://git-scm.org • Installs command-line tools • Includes gitk a basic GUI browser Wednesday, February 20, 13
Getting started $ cd group_project $ git init Creating a new repository Cloning an existing repository $ git clone git://github.com/danreedy/amalgamate.git Wednesday, February 20, 13
Working directory The local copy of files within a repository that are being tracked for changes, additions, and deletion. source: http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html Wednesday, February 20, 13
Untracked unmodified Modified staged Add the file Untrack file edit the file Stage the file Commit the file remove from stage Wednesday, February 20, 13
Index (stage) The intermediate area where you define how a commit will be look, allowing you to select specific changes. source: http://thkoch2001.github.com/whygitisbetter Wednesday, February 20, 13
Handling files $ git add readme.txt $ git add . Adding files to the index (stage) Removing a file from being tracked $ git rm old_file.txt Removing a file from the index (stage) $ git reset -- readme.txt Wednesday, February 20, 13
Untracked unmodified Modified staged Add the file Untrack file edit the file Stage the file Commit the file remove from stage Wednesday, February 20, 13
commit A single point in the git history; the entire history of a project is represented as a set of interrelated commits. Also called a revision or version. Includes a message describing itself. source: http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html Wednesday, February 20, 13
branch An active line of development within a repository. A repository can have many branches, but your working directory is only associated with the one that is checked out. source: http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html Wednesday, February 20, 13
head A named reference to the commit at the tip of a branch. Referring to HEAD means the tip of the checked out branch. source: http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html Wednesday, February 20, 13
MERGE To bring the contents of another branch (possibly from an external repository) into the current branch. source: http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html Wednesday, February 20, 13
source: http://nvie.com/posts/a-successful-git-branching-model/ Time release branches master develop hot xes feature branches Wednesday, February 20, 13
Remote PUSH FETCH unmodified Modified staged edit the file Stage the file Commit the file Icon Credit: Pieter J. Smits, from The Noun Project Wednesday, February 20, 13
PUSH Updating existing files and adding any missing files from a local branch to a remote branch that is a direct ancestor source: http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html Wednesday, February 20, 13
fetch Updating existing files and adding any missing files from a remote branch to a local branch, without merging. source: http://www.kernel.org/pub/software/scm/git/docs/gitglossary.html Wednesday, February 20, 13
hosted git • Github • Free micro plan for students • http://github.com/edu • Bitbucket • Free unlimited plan for students • http://bitbucket.org • Both offer public and private repos Wednesday, February 20, 13
thanks • Each of you for coming • Tom Imboden for the invite • The guys who work for me for putting up with my rants about version control • Dav Glass @davglass from Yahoo! for the swag Wednesday, February 20, 13