Git - Intro to the Basics of DVCS

Preview:

DESCRIPTION

A quick intro to the basics of the Git source code control system and Distributed Version Control Systems (DVCS)

Citation preview

The Git source code control system

Dueling Coders

by Matthew McCullough & Tim Berglund

SVN Git

Why Another?

Not just for versioning source

Distributed Version Control Systems (DVCS)

Value of centralized + decentralized

Easy merging from many branches

Doesn’t pollute

100,000 artifacts

Git Going

Getting Git

• Cygwin

• MacPorts

• Distro-specific package manager

• Binaries

Username Setup

git config --global user.email matthewm@ambientideas.com

URL Styles

• Public Clone URL (Git Protocol)git://github.com/matthewmccullough/helloworld.git

• Private Clone Path (SSH Protocol)git@github.com:matthewmccullough/helloworld.git

• Filesystem Path/users/mccm06/projects/helloworld.git

Cloning Repos

• Command to retrieve a remote repo

• Works against Git and SVN

IDE Tools

• EGit, Eclipse Plugin Update Sitehttp://www.jgit.org/update-sitehttp://github.com/guides/using-the-egit-eclipse-plugin-with-github

• Git4IdeaGet via plugins menu

• Netbeanshttp://git.or.cz/gitwiki/NetBeansPlugin

Sharing Repos

Serve

git help daemon

Serve

git daemon --export-all --base-path=.

Free Git Hosting

Githubhttp://github.com

Gitorioushttp://gitorious.org

Sharing Demo

Add, Checkin

git add *.java

git commit -m‘Did some work’

Switch Branch, Checkout

git branch ANEWBRANCH

git checkout ANEWBRANCH

Push

git push origin master

Pull

git pull origin master

Branching

Just Branches?

Core idea of DVCS

Same as always, but less painful

Branches are local

Branch for every feature

Main is for generals

Branching Demo

Merge

git merge ANEWBRANCH(destination = current branch)

Conflicts

Squash

git merge --squash ANEWBRANCH(destination = current branch)

Tag

git tag VERSION1.0

Cherry Pick

git cherry-pick -r e8ac5ed693(destination = current branch)

Resources

How To Guides

• http://github.com/guides/home

Q&A

Recommended