31
The Git source code control system Dueling Coders by Matthew McCullough & Tim Berglund

Git - Intro to the Basics of DVCS

  • View
    2.816

  • Download
    2

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Git - Intro to the Basics of DVCS

The Git source code control system

Dueling Coders

by Matthew McCullough & Tim Berglund

Page 2: Git - Intro to the Basics of DVCS

SVN Git

Page 3: Git - Intro to the Basics of DVCS

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

Page 4: Git - Intro to the Basics of DVCS

Git Going

Page 5: Git - Intro to the Basics of DVCS

Getting Git

• Cygwin

• MacPorts

• Distro-specific package manager

• Binaries

Page 6: Git - Intro to the Basics of DVCS

Username Setup

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

Page 7: Git - Intro to the Basics of DVCS

URL Styles

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

• Private Clone Path (SSH Protocol)[email protected]:matthewmccullough/helloworld.git

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

Page 8: Git - Intro to the Basics of DVCS

Cloning Repos

• Command to retrieve a remote repo

• Works against Git and SVN

Page 9: Git - Intro to the Basics of DVCS

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

Page 10: Git - Intro to the Basics of DVCS

Sharing Repos

Page 11: Git - Intro to the Basics of DVCS

Serve

git help daemon

Page 12: Git - Intro to the Basics of DVCS

Serve

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

Page 13: Git - Intro to the Basics of DVCS

Free Git Hosting

Githubhttp://github.com

Gitorioushttp://gitorious.org

Page 14: Git - Intro to the Basics of DVCS

Sharing Demo

Page 15: Git - Intro to the Basics of DVCS

Add, Checkin

git add *.java

git commit -m‘Did some work’

Page 16: Git - Intro to the Basics of DVCS

Switch Branch, Checkout

git branch ANEWBRANCH

git checkout ANEWBRANCH

Page 17: Git - Intro to the Basics of DVCS

Push

git push origin master

Page 18: Git - Intro to the Basics of DVCS

Pull

git pull origin master

Page 19: Git - Intro to the Basics of DVCS

Branching

Page 20: Git - Intro to the Basics of DVCS

Just Branches?

Core idea of DVCS

Same as always, but less painful

Branches are local

Branch for every feature

Main is for generals

Page 21: Git - Intro to the Basics of DVCS

Branching Demo

Page 22: Git - Intro to the Basics of DVCS

Merge

git merge ANEWBRANCH(destination = current branch)

Page 23: Git - Intro to the Basics of DVCS

Conflicts

Page 24: Git - Intro to the Basics of DVCS

Squash

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

Page 25: Git - Intro to the Basics of DVCS

Tag

git tag VERSION1.0

Page 26: Git - Intro to the Basics of DVCS

Cherry Pick

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

Page 27: Git - Intro to the Basics of DVCS

Resources

Page 29: Git - Intro to the Basics of DVCS

How To Guides

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

Page 31: Git - Intro to the Basics of DVCS

Q&A