SlideShare a Scribd company logo
Distributed version control with git
— a brief introduction


Joel Krebs
Slides by Oscar Nierstrasz
Why git?
Bob
Bob
      Carol
Bob
        Carol




Alice
          Ted
Bob
                                 Carol




Alice
                                   Ted

        A recipe for disaster!
What is git?
> Distributed revision control system
> Originally developed by Linus Torvalds for the
  development of the Linux Kernel in 2005
> Focus on speed and efficiency
> Quite a unique design and therefore sometimes a bit
  scary and difficult to understand
The git object model
A “blob” is content under
 version control (a file)

          blob
You can have trees of blobs
    (directories of files)

            tree
 blob
            tree
 blob
           blob
A “commit” is a tree of blobs
     (a set of changes)

           commit


            tree
 blob
            tree
 blob
            blob
Most commits modify
                (or merge) earlier
                     commits
                      commit
       commit
                       tree

        tree
                       blob
blob
        tree
blob
        blob
You can “tag” an
interesting commit

        tag
                         commit
                commit
                          tree

                 tree
                          blob
      blob
                 tree
      blob
                 blob
A graph of commits
may belong to a branch   branch

    tag
                         commit
           commit
                          tree

            tree
                          blob
  blob
            tree
  blob
            blob
HEAD
  “HEAD “is the
  current branch
                   branch

  tag
                   commit
         commit
                    tree

          tree
                    blob
blob
          tree
blob
          blob
HEAD


                  branch


                  commit
     commit




Let’s focus on commits
     and branches
Basic git
Create a git repo
                    HEAD

                    master

                     C0
Tell git to “stage”
              changes
HEAD

master

 C0
HEAD

master   Commit your
          changes
 C1

 C0
Collaborating
John                           Jane


Local repo   Public repo   Local repo



                master


                 C1


                 C0
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C1           C1            C1


    C0           C0            C0
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C2           C1            C3


    C1           C0            C1


    C0                         C0
John                                   Jane


    Local repo          Public repo   Local repo



       master              master        master


        C2                  C1            C3


        C1                  C0            C1


        C0                                C0




(nothing new to pull)
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C2           C2            C3


    C1           C1            C1


    C0           C0            C0
John                            Jane


Local repo   Public repo   Local repo



   master       master        master


    C2           C2            C3      C2


    C1           C1            C1


    C0           C0            C0
John                                Jane


Local repo    Public repo      Local repo



   master        master           master


    C2            C2               C4


    C1            C1               C3      C2


    C0            C0               C1


                                   C0




             NB: git pull = fetch + merge
John                               Jane


Local repo   Public repo      Local repo



   master       master           master


    C2           C4               C4


    C1           C3      C2       C3      C2


    C0           C1               C1


                 C0               C0
John                                   Jane


Local repo       Public repo      Local repo



   master           master           master


    C4               C4               C4


    C3      C2       C3      C2       C3      C2


    C1               C1               C1


    C0               C0               C0
Branching
and merging
“origin” refers to the
                    remote repo


   HEAD

   master

origin/master

     C1

     C0
HEAD

                master

origin/master    C2

                 C1

                 C0
HEAD
                         tryout
                master

origin/master    C2

                 C1

                 C0
HEAD

                          tryout
                master

origin/master    C2

                 C1      NB: git checkout –b … =
                            branch + checkout
                 C0
HEAD

                         tryout
                master
                          C3
origin/master    C2

                 C1

                 C0
HEAD

         tryout
master
          C3      C5
 C2
                       origin/master
 C1       C4      C6

 C0                    origin/idea
HEAD

              tryout

               C7
master
         C3    C5
 C2
                       origin/master
 C1      C4    C6

 C0                    origin/idea
tryout
HEAD
               C7
master
         C3    C5
 C2
                       origin/master
 C1      C4    C6

 C0                    origin/idea
HEAD
              tryout
master
               C7
 C8
         C3    C5
 C2
                       origin/master
 C1      C4    C6

 C0                    origin/idea
HEAD
                              tryout
                master
                               C7
origin/master    C8
                         C3    C5
                 C2

                 C1      C4    C6

                 C0                    origin/idea
Overview git workflow



               Remote repository
                  fetch               push
                          Local repository
        pull                          commit
               checkout      Index (cache)
               HEAD                   add
                Working directory
Getting started
First steps

> Follow instructions on P2 Blog for installation
> Send your ssh public key to joel.krebs@students.unibe.ch
> Create meaningful commits with according messages
> Hints that make your life easier:
  —Create a .gitignore file
  —Always pull before you push
  —Don’t panic when merge conflicts occur
More to git
More to git …



> Merging and mergetool
> Squashing commits when merging
> Resolving conflicts
> User authentication with ssh
> gitx and other graphical tools
> git configure — remembering your name
> git remote — multiple remote repos
> github — an open source public repo
> …
Resources



   http://git-scm.com/                  http://book.git-scm.com/index.html



                 http://gitready.com/



                                   https://github.com/




http://www.slideshare.net/chacon/getting-git             http://oreilly.com/
http://creativecommons.org/licenses/by-sa/3.0/

More Related Content

What's hot

工程師必備第一工具 - Git
工程師必備第一工具 - Git工程師必備第一工具 - Git
工程師必備第一工具 - GitAlan Tsai
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub維佋 唐
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowMikhail Melnik
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitColin Su
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagramsDilum Navanjana
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash CourseNilay Binjola
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperJohn Stevenson
 
Learning git
Learning gitLearning git
Learning gitSid Anand
 
Git Terminologies
Git TerminologiesGit Terminologies
Git TerminologiesYash
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial IJim Yeh
 

What's hot (20)

工程師必備第一工具 - Git
工程師必備第一工具 - Git工程師必備第一工具 - Git
工程師必備第一工具 - Git
 
Git Tutorial 教學
Git Tutorial 教學Git Tutorial 教學
Git Tutorial 教學
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
 
版本控制 使用Git & git hub
版本控制   使用Git & git hub版本控制   使用Git & git hub
版本控制 使用Git & git hub
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git workflows
Git workflowsGit workflows
Git workflows
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Learning git
Learning gitLearning git
Learning git
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
git and github
git and githubgit and github
git and github
 
Git Terminologies
Git TerminologiesGit Terminologies
Git Terminologies
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 

Viewers also liked

Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Best Practices in Exception Handling
Best Practices in Exception HandlingBest Practices in Exception Handling
Best Practices in Exception HandlingLemi Orhan Ergin
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git RightSven Peters
 
Git 사용 가이드
Git 사용 가이드Git 사용 가이드
Git 사용 가이드도형 임
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitLukas Fittl
 
svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드Insub Lee
 
Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?Ian Choi
 
Introduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideIntroduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideRohit Arora
 
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git민태 김
 

Viewers also liked (12)

Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git basic
Git basicGit basic
Git basic
 
Best Practices in Exception Handling
Best Practices in Exception HandlingBest Practices in Exception Handling
Best Practices in Exception Handling
 
Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 
Git 사용 가이드
Git 사용 가이드Git 사용 가이드
Git 사용 가이드
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드svn 능력자를 위한 git 개념 가이드
svn 능력자를 위한 git 개념 가이드
 
Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?Git는 머꼬? GitHub는 또 머지?
Git는 머꼬? GitHub는 또 머지?
 
Introduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guideIntroduction to Git/Github - A beginner's guide
Introduction to Git/Github - A beginner's guide
 
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
버전관리를 들어본적 없는 사람들을 위한 DVCS - Git
 

Similar to Quick Introduction to git

Understanding git
Understanding gitUnderstanding git
Understanding gitAvik Das
 
GIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersjiGIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersji3camp
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution beginSeongJae Park
 
That's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICLa FeWeb
 

Similar to Quick Introduction to git (7)

Git社内勉強会
Git社内勉強会Git社内勉強会
Git社内勉強会
 
Understanding git
Understanding gitUnderstanding git
Understanding git
 
M.Mozūras - git
M.Mozūras - gitM.Mozūras - git
M.Mozūras - git
 
GIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersjiGIT rozproszony system kontroli wersji
GIT rozproszony system kontroli wersji
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
 
That's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETICThat's (g)it! par Sébastien Dawans CETIC
That's (g)it! par Sébastien Dawans CETIC
 
Git Going with DVCS v1.6.0
Git Going with DVCS v1.6.0Git Going with DVCS v1.6.0
Git Going with DVCS v1.6.0
 

Recently uploaded

Barbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaaBarbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaaChristiandelacruz884686
 
A DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTH
A DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTHA DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTH
A DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTHaavanipavithran29
 
The Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdf
The Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdfThe Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdf
The Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdfXtreame HDTV
 
The Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy DirectorThe Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy DirectorMark Murphy Director
 
Doorstep ꧁❤8901183002❤꧂Lucknow #ℂall #Girls , Lucknow #ℂall #Girls For Shot...
Doorstep ꧁❤8901183002❤꧂Lucknow  #ℂall #Girls , Lucknow  #ℂall #Girls For Shot...Doorstep ꧁❤8901183002❤꧂Lucknow  #ℂall #Girls , Lucknow  #ℂall #Girls For Shot...
Doorstep ꧁❤8901183002❤꧂Lucknow #ℂall #Girls , Lucknow #ℂall #Girls For Shot...aunty1x1
 
NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...
NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...
NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...Amil Baba Dawood bangali
 
A Collection of Little Johnny Jokes.pptx
A Collection of Little Johnny Jokes.pptxA Collection of Little Johnny Jokes.pptx
A Collection of Little Johnny Jokes.pptxTony Vinckx
 
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By OurDehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Ourrajeshkumar821445
 
Panchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdfPanchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdfSuleman Rana
 
Q4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptx
Q4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptxQ4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptx
Q4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptxramprakash8457
 
A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...
A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...
A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...Art Feeling Films
 
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...Amil baba
 
Lite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptxLite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptxeinarsvan32
 

Recently uploaded (13)

Barbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaaBarbie Presentation Template.pptx aaaaaa
Barbie Presentation Template.pptx aaaaaa
 
A DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTH
A DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTHA DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTH
A DARK AND HOLLOW STAR BY ASHLEY SHUTTLEWORTH
 
The Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdf
The Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdfThe Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdf
The Ultimate Guide to Mom IPTV- Everything You Need to Know in 2024.pdf
 
The Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy DirectorThe Evolution of Animation in Film - Mark Murphy Director
The Evolution of Animation in Film - Mark Murphy Director
 
Doorstep ꧁❤8901183002❤꧂Lucknow #ℂall #Girls , Lucknow #ℂall #Girls For Shot...
Doorstep ꧁❤8901183002❤꧂Lucknow  #ℂall #Girls , Lucknow  #ℂall #Girls For Shot...Doorstep ꧁❤8901183002❤꧂Lucknow  #ℂall #Girls , Lucknow  #ℂall #Girls For Shot...
Doorstep ꧁❤8901183002❤꧂Lucknow #ℂall #Girls , Lucknow #ℂall #Girls For Shot...
 
NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...
NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...
NO1 Pandit Amil Baba In Uk Usa Uae London Canada England America Italy German...
 
A Collection of Little Johnny Jokes.pptx
A Collection of Little Johnny Jokes.pptxA Collection of Little Johnny Jokes.pptx
A Collection of Little Johnny Jokes.pptx
 
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By OurDehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
Dehradun Girls 9719300533 Heat-lava { Dehradun } Whiz ℂall Serviℂe By Our
 
Panchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdfPanchayat Season 3 - Official Trailer.pdf
Panchayat Season 3 - Official Trailer.pdf
 
Q4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptx
Q4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptxQ4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptx
Q4 WEEK 1 JUDGE THE RELEVANCE AND WORTH OF IDEAS.pptx
 
A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...
A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...
A KING’S HEART THE STORY OF TSAR BORIS III (Drama) (Feature Film Project in D...
 
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
NO1 Pandit Black Magic Specialist Expert In Bahawalpur, Sargodha, Sialkot, Sh...
 
Lite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptxLite version of elevator game simplified.pptx
Lite version of elevator game simplified.pptx
 

Quick Introduction to git

  • 1. Distributed version control with git — a brief introduction Joel Krebs Slides by Oscar Nierstrasz
  • 3. Bob
  • 4. Bob Carol
  • 5. Bob Carol Alice Ted
  • 6. Bob Carol Alice Ted A recipe for disaster!
  • 8. > Distributed revision control system > Originally developed by Linus Torvalds for the development of the Linux Kernel in 2005 > Focus on speed and efficiency > Quite a unique design and therefore sometimes a bit scary and difficult to understand
  • 10. A “blob” is content under version control (a file) blob
  • 11. You can have trees of blobs (directories of files) tree blob tree blob blob
  • 12. A “commit” is a tree of blobs (a set of changes) commit tree blob tree blob blob
  • 13. Most commits modify (or merge) earlier commits commit commit tree tree blob blob tree blob blob
  • 14. You can “tag” an interesting commit tag commit commit tree tree blob blob tree blob blob
  • 15. A graph of commits may belong to a branch branch tag commit commit tree tree blob blob tree blob blob
  • 16. HEAD “HEAD “is the current branch branch tag commit commit tree tree blob blob tree blob blob
  • 17. HEAD branch commit commit Let’s focus on commits and branches
  • 19. Create a git repo HEAD master C0
  • 20. Tell git to “stage” changes HEAD master C0
  • 21. HEAD master Commit your changes C1 C0
  • 23. John Jane Local repo Public repo Local repo master C1 C0
  • 24. John Jane Local repo Public repo Local repo master master master C1 C1 C1 C0 C0 C0
  • 25. John Jane Local repo Public repo Local repo master master master C2 C1 C3 C1 C0 C1 C0 C0
  • 26. John Jane Local repo Public repo Local repo master master master C2 C1 C3 C1 C0 C1 C0 C0 (nothing new to pull)
  • 27. John Jane Local repo Public repo Local repo master master master C2 C2 C3 C1 C1 C1 C0 C0 C0
  • 28. John Jane Local repo Public repo Local repo master master master C2 C2 C3 C2 C1 C1 C1 C0 C0 C0
  • 29. John Jane Local repo Public repo Local repo master master master C2 C2 C4 C1 C1 C3 C2 C0 C0 C1 C0 NB: git pull = fetch + merge
  • 30. John Jane Local repo Public repo Local repo master master master C2 C4 C4 C1 C3 C2 C3 C2 C0 C1 C1 C0 C0
  • 31. John Jane Local repo Public repo Local repo master master master C4 C4 C4 C3 C2 C3 C2 C3 C2 C1 C1 C1 C0 C0 C0
  • 33. “origin” refers to the remote repo HEAD master origin/master C1 C0
  • 34. HEAD master origin/master C2 C1 C0
  • 35. HEAD tryout master origin/master C2 C1 C0
  • 36. HEAD tryout master origin/master C2 C1 NB: git checkout –b … = branch + checkout C0
  • 37. HEAD tryout master C3 origin/master C2 C1 C0
  • 38. HEAD tryout master C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 39. HEAD tryout C7 master C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 40. tryout HEAD C7 master C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 41. HEAD tryout master C7 C8 C3 C5 C2 origin/master C1 C4 C6 C0 origin/idea
  • 42. HEAD tryout master C7 origin/master C8 C3 C5 C2 C1 C4 C6 C0 origin/idea
  • 43. Overview git workflow Remote repository fetch push Local repository pull commit checkout Index (cache) HEAD add Working directory
  • 45. First steps > Follow instructions on P2 Blog for installation > Send your ssh public key to joel.krebs@students.unibe.ch > Create meaningful commits with according messages > Hints that make your life easier: —Create a .gitignore file —Always pull before you push —Don’t panic when merge conflicts occur
  • 47. More to git … > Merging and mergetool > Squashing commits when merging > Resolving conflicts > User authentication with ssh > gitx and other graphical tools > git configure — remembering your name > git remote — multiple remote repos > github — an open source public repo > …
  • 48. Resources http://git-scm.com/ http://book.git-scm.com/index.html http://gitready.com/ https://github.com/ http://www.slideshare.net/chacon/getting-git http://oreilly.com/