a small git introduction

Upload: andiherten

Post on 04-Jun-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 A Small Git Introduction

    1/97

    MitgliedderHelmholtz-Gemeinschaft

    Computing Online Meeting

    13 January 2014 | Andreas Herten

    A Small Git Introduction

    1

  • 8/13/2019 A Small Git Introduction

    2/97

    MitgliedderHelmholtz-Gemeinschaft

    Motivation

    ROOT switched from SVN to Git last year

    FairRoot will also move to Git (eventually)Announced at last Collaboration Meeting

    !WTF isGit!?

    2

    I worked a bit with Git

    I am by no means an expert

    Think of this talk as an appetizer

    Disclaimer

    http://www.flickr.com/photos/amanky/3165141991/http://www.flickr.com/photos/amanky/3165141991/http://www.flickr.com/photos/amanky/3165141991/http://www.flickr.com/photos/amanky/3165141991/http://www.flickr.com/photos/amanky/3165141991/https://indico.cern.ch/getFile.py/access?contribId=0&resId=0&materialId=slides&confId=246803https://indico.cern.ch/getFile.py/access?contribId=0&resId=0&materialId=slides&confId=246803
  • 8/13/2019 A Small Git Introduction

    3/97

    MitgliedderHelmholtz-Gemeinschaft

    3

  • 8/13/2019 A Small Git Introduction

    4/97

    MitgliedderHelmholtz-Gemeinschaft

    * 2005 by Linus Torvalds for development of Linux

    kernel

    Git is a

    "modern

    "distributed version control,"designed for speed and efficiency.

    Inspired by CVS (like SVN), but

    Take CVS as an example of what not to do; if in doubt,make the exact opposite decision.

    4

  • 8/13/2019 A Small Git Introduction

    5/97

    MitgliedderHelmholtz-Gemeinschaft

    Used by

    Linux Kernel

    GNOME

    GNU (Autoconf, Automake, core utils)

    Perl

    QT

    Many smaller Opern Source projects

    Publicity through github.com

    Not: Python, Facebook (Mercurial)

    5

    http://github.com/http://github.com/https://git.wiki.kernel.org/index.php/GitProjectshttps://git.wiki.kernel.org/index.php/GitProjects
  • 8/13/2019 A Small Git Introduction

    6/97

    MitgliedderHelmholtz-Gemeinschaft

    Used by

    6

    0,9%

    2,8%

    3,0%

    12,6%

    6,8%

    58,3%

    0,6%

    2,7%

    4,6%

    13,3%

    12,8%

    51,3%

    2,2%

    2,3%

    2,6%

    8,9%

    4,4%

    23,2%

    46,0%

    1,4%

    2,2%

    3,6%

    4,5%

    6,0%

    30,3%

    37,8%

    IBM Rational Team Concert

    IBM Rational ClearCase

    Mercurial

    CVS

    GitHub

    Git

    Subversion

    What is the primary source code management system youtypically use? (Choose one.)

    2013

    2012

    2011

    2010

    Eclipse IDE survey 2013

    2010 2013

    SVN

    Git

    60,0% 40,0%

    7,0% 36,0%

    https://git.wiki.kernel.org/index.php/GitProjectshttps://git.wiki.kernel.org/index.php/GitProjects
  • 8/13/2019 A Small Git Introduction

    7/97

    MitgliedderHelmholtz-Gemeinschaft

    Main Features/Benets

    Git is a

    "modern

    "distributed

    version

    control,

    "designed for

    speed and

    efficiency.

    7

    http://en.wikipedia.org/wiki/Git_(software)#Designhttp://en.wikipedia.org/wiki/Git_(software)#Design
  • 8/13/2019 A Small Git Introduction

    8/97

    MitgliedderHelmholtz-Gemeinschaft

    Main Features/Benets

    Git is a

    "modern

    "distributed

    version

    control,

    "designed for

    speed and

    efficiency.

    7

    Learned from CVS / SVN / BitKeeper / MonotoneCompatibility to existing protocols: HTTP, FTP, rsync, sshCryptographic authentication of history (SHA-1)Open Source

    http://en.wikipedia.org/wiki/Git_(software)#Designhttp://en.wikipedia.org/wiki/Git_(software)#Design
  • 8/13/2019 A Small Git Introduction

    9/97

    MitgliedderHelmholtz-Gemeinschaft

    Main Features/Benets

    Git is a

    "modern

    "distributed

    version

    control,

    "designed for

    speed and

    efficiency.

    7

    Learned from CVS / SVN / BitKeeper / MonotoneCompatibility to existing protocols: HTTP, FTP, rsync, sshCryptographic authentication of history (SHA-1)Open Source

    Every developer has (complete) local copy!work offline!Every clone = backupNon-linearity: Branching, merging

    http://en.wikipedia.org/wiki/Git_(software)#Designhttp://en.wikipedia.org/wiki/Git_(software)#Design
  • 8/13/2019 A Small Git Introduction

    10/97

    MitgliedderHelmholtz-Gemeinschaft

    Main Features/Benets

    Git is a

    "modern

    "distributed

    version

    control,

    "designed for

    speed and

    efficiency.

    7

    Learned from CVS / SVN / BitKeeper / MonotoneCompatibility to existing protocols: HTTP, FTP, rsync, sshCryptographic authentication of history (SHA-1)Open Source

    Every developer has (complete) local copy!work offline!Every clone = backupNon-linearity: Branching, merging

    Fast!Never lose dataLots of shorthandsDeltas

    http://en.wikipedia.org/wiki/Git_(software)#Designhttp://en.wikipedia.org/wiki/Git_(software)#Design
  • 8/13/2019 A Small Git Introduction

    11/97

    MitgliedderHelmholtz-Gemeinschaft

    Git:

    Local working area is also repository [0..N] remote repositories to push les to (and les from)

    Commits are identied by their SHA-1 hashes, not continuousnumbers; navigate with shorthands

    Branches (/tags) are commits and easily changeable (deltas!),

    not copies of a certain stage of the repo

    8

    Git vs. SVN

  • 8/13/2019 A Small Git Introduction

    12/97

    MitgliedderHelmholtz-Gemeinschaft

    Git:

    Local working area is also repository [0..N]remote repositories to push les to (and les from)

    Commits areidentied by their SHA-1 hashes, not continuousnumbers; navigate with shorthands

    Branches (/tags) are commits and easily changeable (deltas!),

    not copies of a certain stage of the repo

    8

    Git vs. SVN

    SVN Git

    svn checkout http://abc.de/fg/ git clone http://abc.de/fg/

    svn update git pull

    svn add git add

    svn commit -m "Panda" git commit -m "Panda" & git pushsvn diff| less git diff

    svn status git status

    svn copy svn://svn.abc.de/oldbranchsvn://svn.abc.de/newbranch

    git branch oldbranch newbranch

    git commit --amend

    git svn dcommit

    http://svn//svn.abc.de/newbranchhttp://svn//svn.abc.de/oldbranchhttp://svn//svn.abc.de/oldbranchhttp://svn//svn.abc.de/oldbranchhttp://svn//svn.abc.de/newbranchhttp://svn//svn.abc.de/newbranchhttp://svn//svn.abc.de/oldbranchhttp://svn//svn.abc.de/oldbranchhttp://abc.de/fg/http://abc.de/fg/http://abc.de/fg/http://abc.de/fg/
  • 8/13/2019 A Small Git Introduction

    13/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

  • 8/13/2019 A Small Git Introduction

    14/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo

  • 8/13/2019 A Small Git Introduction

    15/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git init

  • 8/13/2019 A Small Git Introduction

    16/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo

  • 8/13/2019 A Small Git Introduction

    17/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo$ ll -a

  • 8/13/2019 A Small Git Introduction

    18/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo$ ll -atotal 0drwxr-xr-x 3 Andi staff 102B Jan 11 16:59 .drwxr-xr-x 11 Andi staff 374B Jan 11 16:59 ..drwxr-xr-x 8 Andi staff 272B Jan 11 17:00 .gitAndi at MacandiR in ~/samplerepo

  • 8/13/2019 A Small Git Introduction

    19/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo$ ll -atotal 0drwxr-xr-x 3 Andi staff 102B Jan 11 16:59 .drwxr-xr-x 11 Andi staff 374B Jan 11 16:59 ..drwxr-xr-x 8 Andi staff 272B Jan 11 17:00 .gitAndi at MacandiR in ~/samplerepo

    $ echo "Hello Panda Computing guys" > panda.txtAndi at MacandiR in ~/samplerepo

  • 8/13/2019 A Small Git Introduction

    20/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo$ ll -atotal 0drwxr-xr-x 3 Andi staff 102B Jan 11 16:59 .drwxr-xr-x 11 Andi staff 374B Jan 11 16:59 ..drwxr-xr-x 8 Andi staff 272B Jan 11 17:00 .gitAndi at MacandiR in ~/samplerepo

    $ echo "Hello Panda Computing guys" > panda.txtAndi at MacandiR in ~/samplerepo$ git add panda.txtAndi at MacandiR in ~/samplerepo

  • 8/13/2019 A Small Git Introduction

    21/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo$ ll -atotal 0drwxr-xr-x 3 Andi staff 102B Jan 11 16:59 .drwxr-xr-x 11 Andi staff 374B Jan 11 16:59 ..drwxr-xr-x 8 Andi staff 272B Jan 11 17:00 .gitAndi at MacandiR in ~/samplerepo

    $ echo "Hello Panda Computing guys" > panda.txtAndi at MacandiR in ~/samplerepo$ git add panda.txtAndi at MacandiR in ~/samplerepo$ git status

  • 8/13/2019 A Small Git Introduction

    22/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo$ ll -atotal 0drwxr-xr-x 3 Andi staff 102B Jan 11 16:59 .drwxr-xr-x 11 Andi staff 374B Jan 11 16:59 ..drwxr-xr-x 8 Andi staff 272B Jan 11 17:00 .gitAndi at MacandiR in ~/samplerepo

    $ echo "Hello Panda Computing guys" > panda.txtAndi at MacandiR in ~/samplerepo$ git add panda.txtAndi at MacandiR in ~/samplerepo$ git status# On branch master## Initial commit## Changes to be committed:# (use "git rm --cached ..." to unstage)

    # # new file: panda.txt#Andi at MacandiR in ~/samplerepo

  • 8/13/2019 A Small Git Introduction

    23/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepo$ git initInitialized empty Git repository in ~/samplerepo/.git/Andi at MacandiR in ~/samplerepo$ ll -atotal 0drwxr-xr-x 3 Andi staff 102B Jan 11 16:59 .drwxr-xr-x 11 Andi staff 374B Jan 11 16:59 ..drwxr-xr-x 8 Andi staff 272B Jan 11 17:00 .gitAndi at MacandiR in ~/samplerepo

    $ echo "Hello Panda Computing guys" > panda.txtAndi at MacandiR in ~/samplerepo$ git add panda.txtAndi at MacandiR in ~/samplerepo$ git status# On branch master## Initial commit## Changes to be committed:# (use "git rm --cached ..." to unstage)

    # # new file: panda.txt#Andi at MacandiR in ~/samplerepo$ git commit -m "Initial Panda"[master (root-commit) 1ac7db6] Initial Panda1 file changed, 1 insertion(+)create mode 100644 panda.txt

  • 8/13/2019 A Small Git Introduction

    24/97

    MitgliedderHelmholtz-Gemeinschaft

    9

    Git Walkthrough (I)

  • 8/13/2019 A Small Git Introduction

    25/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*

  • 8/13/2019 A Small Git Introduction

    26/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git log

  • 8/13/2019 A Small Git Introduction

    27/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*

  • 8/13/2019 A Small Git Introduction

    28/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*$ tree .git/.git/

    "##COMMIT_EDITMSGAndi at MacandiR in ~/samplerepoon master*

  • 8/13/2019 A Small Git Introduction

    29/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*$ tree .git/.git/

    "##COMMIT_EDITMSGAndi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    30/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*$ tree .git/.git/

    "##COMMIT_EDITMSGAndi at MacandiR in ~/samplerepoon master*$ more .git/HEAD

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    31/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*$ tree .git/.git/

    "##COMMIT_EDITMSGAndi at MacandiR in ~/samplerepoon master*$ more .git/HEADref: refs/heads/masterAndi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    32/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*$ tree .git/.git/

    "##COMMIT_EDITMSGAndi at MacandiR in ~/samplerepoon master*$ more .git/HEADref: refs/heads/masterAndi at MacandiR in ~/samplerepoon master*$ more .git/refs/heads/master

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    33/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*$ tree .git/.git/

    "##COMMIT_EDITMSGAndi at MacandiR in ~/samplerepoon master*$ more .git/HEADref: refs/heads/masterAndi at MacandiR in ~/samplerepoon master*$ more .git/refs/heads/masterca9be0af4cf653edd31940cbb80fe3f2b3c12077Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    34/97

    MitgliedderHelmholtz-Gemeinschaft

    10

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial PandaAndi at MacandiR in ~/samplerepoon master*$ tree .git/.git/

    "##COMMIT_EDITMSGAndi at MacandiR in ~/samplerepoon master*$ more .git/HEADref: refs/heads/masterAndi at MacandiR in ~/samplerepoon master*$ more .git/refs/heads/masterca9be0af4cf653edd31940cbb80fe3f2b3c12077Andi at MacandiR in ~/samplerepoon master*$ echo "How are you doing" >> panda.txtAndi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    35/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    36/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    37/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git status

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    38/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git status# On branch master# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    39/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git status# On branch master# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon master*$ git commit -a -m "Added question"

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

  • 8/13/2019 A Small Git Introduction

    40/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git status# On branch master# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon master*$ git commit -a -m "Added question"[master e1ace33] Added question1 file changed, 1 insertion(+)Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]

    "##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

    lk h h ( )

  • 8/13/2019 A Small Git Introduction

    41/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git status# On branch master# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon master*$ git commit -a -m "Added question"[master e1ace33] Added question1 file changed, 1 insertion(+)Andi at MacandiR in ~/samplerepoon master*$ git log

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

    Gi W lk h h (I)

  • 8/13/2019 A Small Git Introduction

    42/97

    MitgliedderHelmholtz-Gemeinschaft

    11

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ git status# On branch master# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon master*$ git commit -a -m "Added question"[master e1ace33] Added question1 file changed, 1 insertion(+)Andi at MacandiR in ~/samplerepoon master*$ git logcommit e1ace3386caacbd40ed181bc527ba05bb9eba76eAuthor: AndiH Date: Sat Jan 11 17:26:25 2014 +0100

    Added question

    commit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial Panda

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

    Gi W lk h h (I)

  • 8/13/2019 A Small Git Introduction

    43/97

    MitgliedderHelmholtz-Gemeinschaft

    12

    Git Walkthrough (I)

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

    Git W lkth h (I)

  • 8/13/2019 A Small Git Introduction

    44/97

    MitgliedderHelmholtz-Gemeinschaft

    12

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

    Git W lkth h (I)

  • 8/13/2019 A Small Git Introduction

    45/97

    MitgliedderHelmholtz-Gemeinschaft

    12

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ head -n +1 panda.txt > tmpPnd.txt; mv tmpPnd.txt panda.txt;echo "How are you doing?" >> panda.txtAndi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack#refs "##heads $ #master #tags

    Git W lkth h (I)

  • 8/13/2019 A Small Git Introduction

    46/97

    MitgliedderHelmholtz-Gemeinschaft

    12

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ head -n +1 panda.txt > tmpPnd.txt; mv tmpPnd.txt panda.txt;echo "How are you doing?" >> panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txt

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack

    #refs "##heads $ #master #tags

    Git W lkth h (I)

  • 8/13/2019 A Small Git Introduction

    47/97

    MitgliedderHelmholtz-Gemeinschaft

    12

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ head -n +1 panda.txt > tmpPnd.txt; mv tmpPnd.txt panda.txt;echo "How are you doing?" >> panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack

    #refs "##heads $ #master #tags

    Git W lkth h (I)

  • 8/13/2019 A Small Git Introduction

    48/97

    MitgliedderHelmholtz-Gemeinschaft

    12

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ head -n +1 panda.txt > tmpPnd.txt; mv tmpPnd.txt panda.txt;echo "How are you doing?" >> panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git commit -a --amend[master b82f014] Added question

    1 file changed, 1 insertion(+)Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack

    #refs "##heads $ #master #tags

    Git W lkth h (I)

  • 8/13/2019 A Small Git Introduction

    49/97

    MitgliedderHelmholtz-Gemeinschaft

    12

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ head -n +1 panda.txt > tmpPnd.txt; mv tmpPnd.txt panda.txt;echo "How are you doing?" >> panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git commit -a --amend[master b82f014] Added question

    1 file changed, 1 insertion(+)Andi at MacandiR in ~/samplerepoon master*$ git logcommit b82f01496c3568520212580bb722cee878b47017Author: AndiH Date: Sat Jan 11 17:26:25 2014 +0100

    Added question

    commit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial Panda

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack

    #refs "##heads $ #master #tags

    Git Walkthrough (I)

  • 8/13/2019 A Small Git Introduction

    50/97

    MitgliedderHelmholtz-Gemeinschaft

    13

    Git Walkthrough (I)

    Andi at MacandiR in ~/samplerepoon master*$ head -n +1 panda.txt > tmpPnd.txt; mv tmpPnd.txt panda.txt;echo "How are you doing?" >> panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git commit -a --amend[master b82f014] Added question

    1 file changed, 1 insertion(+)Andi at MacandiR in ~/samplerepoon master*$ git logcommit b82f01496c3568520212580bb722cee878b47017Author: AndiH Date: Sat Jan 11 17:26:25 2014 +0100

    Added question

    commit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    Initial Panda

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info

    $ #pack

    #refs "##heads $ #master #tags

    !CONTINUE?Git Walkthrough II: Branching

    !END?

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    51/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    52/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    53/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master* $ tree .git/

    .git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    54/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bug

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    55/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    56/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    57/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch* bug masterAndi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original"##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    58/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch* bug masterAndi at MacandiR in ~/samplerepoon bug*$ ll

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    59/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch* bug masterAndi at MacandiR in ~/samplerepoon bug*$ lltotal 8-rw-r--r-- 1 Andi staff 21B Jan 11 17:40 panda.txtAndi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    60/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch* bug masterAndi at MacandiR in ~/samplerepoon bug*$ lltotal 8-rw-r--r-- 1 Andi staff 21B Jan 11 17:40 panda.txtAndi at MacandiR in ~/samplerepoon bug*$ cat .git/HEAD

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    61/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch* bug masterAndi at MacandiR in ~/samplerepoon bug*$ lltotal 8-rw-r--r-- 1 Andi staff 21B Jan 11 17:40 panda.txtAndi at MacandiR in ~/samplerepoon bug*$ cat .git/HEADref: refs/heads/bugAndi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    62/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch* bug masterAndi at MacandiR in ~/samplerepoon bug*$ lltotal 8-rw-r--r-- 1 Andi staff 21B Jan 11 17:40 panda.txtAndi at MacandiR in ~/samplerepoon bug*$ cat .git/HEADref: refs/heads/bugAndi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info$ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    63/97

    MitgliedderHelmholtz-Gemeinschaft

    14

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon master*$ git branch bugAndi at MacandiR in ~/samplerepoon master*$ git checkout bugSwitched to branch 'bug'Andi at MacandiR in ~/samplerepoon bug*$ git branch* bug masterAndi at MacandiR in ~/samplerepoon bug*$ lltotal 8-rw-r--r-- 1 Andi staff 21B Jan 11 17:40 panda.txtAndi at MacandiR in ~/samplerepoon bug*$ cat .git/HEADref: refs/heads/bugAndi at MacandiR in ~/samplerepoon bug*$ ll > dirlist.txt; echo "Superbug" >> panda.txtAndi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg$ "##commit-msg$ "##post-applypatch$ "##[]"##hooks.original

    "##index"##logs$ "##HEAD$ #refs$ #heads$ #master"##objects$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##ca$ $ "##9be0af4cf653edd31940cbb80fe3f2b3c12077$ $ #dee9cb855b71059b4a7da8d1eb83134ed87429$ "##info$ #pack#refs "##heads $ #master #tags

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info$ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    64/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    Git Walkthrough (II: Branching)

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info$ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    65/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info$ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    66/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon bug*$ git status

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info$ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    67/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon bug*$ git status# On branch bug# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    ## Untracked files:# (use "git add ..." to include in what will becommitted)## dirlist.txt

    no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    68/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon bug*$ git status# On branch bug# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    ## Untracked files:# (use "git add ..." to include in what will becommitted)## dirlist.txt

    no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon bug*$ git add panda.txt dirlist.txtAndi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    69/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon bug*$ git status# On branch bug# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    ## Untracked files:# (use "git add ..." to include in what will becommitted)## dirlist.txt

    no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon bug*$ git add panda.txt dirlist.txtAndi at MacandiR in ~/samplerepoon bug*$ git commit -m "Bugfixing"

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    70/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    Git Walkthrough (II: Branching)

    Andi at MacandiR in ~/samplerepoon bug*$ git status# On branch bug# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #

    # Untracked files:# (use "git add ..." to include in what will becommitted)## dirlist.txt

    no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon bug*$ git add panda.txt dirlist.txtAndi at MacandiR in ~/samplerepoon bug*$ git commit -m "Bugfixing"

    [bug c76ef60] Bugfixing2 files changed, 4 insertions(+)create mode 100644 dirlist.txtAndi at MacandiR in ~/samplerepoon bug*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    71/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    G t a t oug ( : a c g)

    Andi at MacandiR in ~/samplerepoon bug*$ git status# On branch bug# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #

    # Untracked files:# (use "git add ..." to include in what will becommitted)## dirlist.txt

    no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon bug*$ git add panda.txt dirlist.txtAndi at MacandiR in ~/samplerepoon bug*$ git commit -m "Bugfixing"

    [bug c76ef60] Bugfixing2 files changed, 4 insertions(+)create mode 100644 dirlist.txtAndi at MacandiR in ~/samplerepoon bug*$ git checkout master

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    72/97

    MitgliedderHelmholtz-Gemeinschaft

    15

    g ( g)

    Andi at MacandiR in ~/samplerepoon bug*$ git status# On branch bug# Changes not staged for commit:# (use "git add ..." to update what will becommitted)# (use "git checkout -- ..." to discard changes inworking directory)## modified: panda.txt

    #

    # Untracked files:# (use "git add ..." to include in what will becommitted)## dirlist.txt

    no changes added to commit (use "git add" and/or "git commit-a)Andi at MacandiR in ~/samplerepoon bug*$ git add panda.txt dirlist.txtAndi at MacandiR in ~/samplerepoon bug*$ git commit -m "Bugfixing"

    [bug c76ef60] Bugfixing2 files changed, 4 insertions(+)create mode 100644 dirlist.txtAndi at MacandiR in ~/samplerepoon bug*$ git checkout masterSwitched to branch 'master'Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    73/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    g ( g)

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    74/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    g ( g)

    Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    75/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    g ( g)

    Andi at MacandiR in ~/samplerepoon master*$ ll

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    76/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    g g

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    77/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    g g

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txt

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    78/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    g g

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    79/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    g g

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git merge bug

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    80/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git merge bugAuto-merging panda.txt

    CONFLICT (content): Merge conflict in panda.txtAutomatic merge failed; fix conflicts and then commit theresult.Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

  • 8/13/2019 A Small Git Introduction

    81/97

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    82/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git merge bugAuto-merging panda.txt

    CONFLICT (content): Merge conflict in panda.txtAutomatic merge failed; fix conflicts and then commit theresult.Andi at MacandiR in ~/samplerepoon master*$ cat panda.txt

    Hello !"guys

    > bugAndi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    83/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git merge bugAuto-merging panda.txt

    CONFLICT (content): Merge conflict in panda.txtAutomatic merge failed; fix conflicts and then commit theresult.Andi at MacandiR in ~/samplerepoon master*$ cat panda.txt

    Hello !"guys

    > bugAndi at MacandiR in ~/samplerepoon master*$ git commit

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    84/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git merge bugAuto-merging panda.txt

    CONFLICT (content): Merge conflict in panda.txtAutomatic merge failed; fix conflicts and then commit theresult.Andi at MacandiR in ~/samplerepoon master*$ cat panda.txt

    Hello !"guys

    > bug

    Andi at MacandiR in ~/samplerepoon master*$ git commit[master ebcc2cc] Merge branch 'bug'Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    85/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git merge bugAuto-merging panda.txt

    CONFLICT (content): Merge conflict in panda.txtAutomatic merge failed; fix conflicts and then commit theresult.Andi at MacandiR in ~/samplerepoon master*$ cat panda.txt

    Hello !"guys

    > bug

    Andi at MacandiR in ~/samplerepoon master*$ git commit[master ebcc2cc] Merge branch 'bug'Andi at MacandiR in ~/samplerepoon master*$ git branch -d bug

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    86/97

    MitgliedderHelmholtz-Gemeinschaft

    16

    Andi at MacandiR in ~/samplerepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 40B Jan 11 17:44 panda.txtAndi at MacandiR in ~/samplerepoon master*$ cat panda.txtHello Panda Computing guysHow are you doing?Andi at MacandiR in ~/samplerepoon master*$ git merge bugAuto-merging panda.txt

    CONFLICT (content): Merge conflict in panda.txtAutomatic merge failed; fix conflicts and then commit theresult.Andi at MacandiR in ~/samplerepoon master*$ cat panda.txt

    Hello !"guys

    > bug

    Andi at MacandiR in ~/samplerepoon master*$ git commit[master ebcc2cc] Merge branch 'bug'Andi at MacandiR in ~/samplerepoon master*$ git branch -d bugDeleted branch bug (was c76ef60).Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    87/97

    MitgliedderHelmholtz-Gemeinschaft

    17

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    88/97

    MitgliedderHelmholtz-Gemeinschaft

    17

    Andi at MacandiR in ~/samplerepoon master*

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

    Git Walkthrough (II: Branching)

  • 8/13/2019 A Small Git Introduction

    89/97

    MitgliedderHelmholtz-Gemeinschaft

    17

    Andi at MacandiR in ~/samplerepoon master*$ git logcommit ebcc2cc8fb0c5f33fe5c9f4015e4fa5a545793b6Merge: b82f014 c76ef60Author: AndiH Date: Sat Jan 11 17:46:53 2014 +0100

    Merge branch 'bug'

    * bug: Bugfixing

    Conflicts:

    panda.txt

    commit c76ef6039b3dfeb3cfe9277df9f2bdae46be00fcAuthor: AndiH Date: Sat Jan 11 17:43:45 2014 +0100

    Bugfixing

    commit b82f01496c3568520212580bb722cee878b47017

    Author: AndiH Date: Sat Jan 11 17:26:25 2014 +0100

    Added question

    commit ca9be0af4cf653edd31940cbb80fe3f2b3c12077Author: AndiH Date: Sat Jan 11 17:24:07 2014 +0100

    $ tree .git/.git/"##COMMIT_EDITMSG"##HEAD"##config"##hooks$ "##applypatch-msg"##hooks.original"##index"##logs$ "##HEAD

    $ #refs$ #heads$ "##bug$ #master"##objects$ "##15$ $ #284e3caad4de7cb15f73bba4c908aed7f586f3$ "##1a$ $ #833f02850d668161a34b4a4d485fde71e2a664$ "##2e$ $ #7b167eeb01dc76e7a69e2d8dd5f52279c73938$ "##41$ $ #40ce8e7a6ca7c689fd8630c94c4ab3d1f847dc$ "##info

    $ #pack#refs "##heads $ "##bug $ #master #tags

  • 8/13/2019 A Small Git Introduction

    90/97

    Git Walkthrough (III: Collab.)

  • 8/13/2019 A Small Git Introduction

    91/97

    MitgliedderHelmholtz-Gemeinschaft

    18

    Andi at MacandiR in ~$ git clone ~/samplerepo/ ~/anotherrepoCloning into '/Users/Andi/anotherrepo'...done.Checking connectivity... doneAndi at MacandiR in ~$ cd anotherrepo/Andi at MacandiR in ~/anotherrepoon master*$ lltotal 16-rw-r--r-- 1 Andi staff 122B Jan 13 09:14dirlist.txt-rw-r--r-- 1 Andi staff 53B Jan 13 09:14 panda.txtAndi at MacandiR in ~/anotherrepoon master*$ git rm dirlist.txtrm 'dirlist.txt'Andi at MacandiR in ~/anotherrepoon master*$ git status# On branch master# Changes to be committed:# (use "git reset HEAD ..." to unstage)## deleted: dirlist.txt#Andi at MacandiR in ~/anotherrepoon master*$ git commit -m "deleted file"[master 1c89873] deleted file1 file changed, 3 deletions(-)delete mode 100644 dirlist.txtAndi at MacandiR in ~/anotherrepoon master*$ lltotal 8-rw-r--r-- 1 Andi staff 53B Jan 13 09:14 panda.txtAndi at MacandiR in ~/anotherrepoon master*

  • 8/13/2019 A Small Git Introduction

    92/97

    Git walkthrough

  • 8/13/2019 A Small Git Introduction

    93/97

    MitgliedderHelmholtz-Gemeinschaft

    19

    Git Overview Example

  • 8/13/2019 A Small Git Introduction

    94/97

    MitgliedderHelmholtz-Gemeinschaft

    20

    Resources

  • 8/13/2019 A Small Git Introduction

    95/97

    MitgliedderHelmholtz-Gemeinschaft

    Tutorials

    man gittutorial(or, prettier, on git-scm.com)

    Codeschool interactive Git tutorial: http://gitreal.codeschool.com/ Github interactive tryout: http://try.github.io/

    Learn Git branching: http://pcottle.github.io/learnGitBranching/

    Vogella Git tutorial: http://www.vogella.com/

    Git Book: http://git-scm.com/doc

    Scott Chacons Git talks: https://github.com/schacon/

    ROOT

    F. Rademakers slides on Moving ROOT from Subversion to Git

    ROOTs Git Tips and Tricks:http://root.cern.ch/

    SVN:

    https://git.wiki.kernel.org/index.php/GitSvnCrashCourse

    https://git.wiki.kernel.org/index.php/SvnMigration

    21

    Resources

    https://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttp://root.cern.ch/drupal/content/git-tips-and-trickshttps://github.com/schacon/git-presentationshttps://github.com/schacon/git-presentationshttp://www.vogella.com/tutorials/Git/article.htmlhttp://pcottle.github.io/learnGitBranching/https://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttp://root.cern.ch/drupal/content/git-tips-and-trickshttp://root.cern.ch/drupal/content/git-tips-and-trickshttp://www.physikblog.eu/http://www.physikblog.eu/https://github.com/schacon/git-presentationshttps://github.com/schacon/git-presentationshttp://git-scm.com/dochttp://git-scm.com/dochttp://www.vogella.com/tutorials/Git/article.htmlhttp://www.vogella.com/tutorials/Git/article.htmlhttp://pcottle.github.io/learnGitBranching/http://pcottle.github.io/learnGitBranching/http://try.github.io/http://try.github.io/http://gitreal.codeschool.com/http://gitreal.codeschool.com/http://git-scm.com/docs/gittutorialhttp://git-scm.com/docs/gittutorial
  • 8/13/2019 A Small Git Introduction

    96/97

    MitgliedderHelmholtz-Gemeinschaft

    Tutorials

    man gittutorial(or, prettier, on git-scm.com)

    Codeschool interactive Git tutorial: http://gitreal.codeschool.com/ Github interactive tryout: http://try.github.io/

    Learn Git branching: http://pcottle.github.io/learnGitBranching/

    Vogella Git tutorial: http://www.vogella.com/

    Git Book: http://git-scm.com/doc

    Scott Chacons Git talks: https://github.com/schacon/

    ROOT

    F. Rademakers slides on Moving ROOT from Subversion to Git

    ROOTs Git Tips and Tricks:http://root.cern.ch/

    SVN:

    https://git.wiki.kernel.org/index.php/GitSvnCrashCourse

    https://git.wiki.kernel.org/index.php/SvnMigration

    21

    THANKS

    List of Resources Used

    https://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttp://root.cern.ch/drupal/content/git-tips-and-trickshttps://github.com/schacon/git-presentationshttps://github.com/schacon/git-presentationshttp://www.vogella.com/tutorials/Git/article.htmlhttp://pcottle.github.io/learnGitBranching/https://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/SvnMigrationhttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttps://git.wiki.kernel.org/index.php/GitSvnCrashCoursehttp://root.cern.ch/drupal/content/git-tips-and-trickshttp://root.cern.ch/drupal/content/git-tips-and-trickshttp://www.physikblog.eu/http://www.physikblog.eu/https://github.com/schacon/git-presentationshttps://github.com/schacon/git-presentationshttp://git-scm.com/dochttp://git-scm.com/dochttp://www.vogella.com/tutorials/Git/article.htmlhttp://www.vogella.com/tutorials/Git/article.htmlhttp://pcottle.github.io/learnGitBranching/http://pcottle.github.io/learnGitBranching/http://try.github.io/http://try.github.io/http://gitreal.codeschool.com/http://gitreal.codeschool.com/http://git-scm.com/docs/gittutorialhttp://git-scm.com/docs/gittutorial
  • 8/13/2019 A Small Git Introduction

    97/97

    derHelmholtz-Gemeinschaft

    [2]:Appetizers picture by Amancay Maahs

    [3]:Git logo from Wikimedia Commons

    [6]:Eclipse IDE Survey from their presentation on Slideshare

    Rest is mine

    http://www.slideshare.net/IanSkerrett/eclipse-survey-2013-report-final/14http://www.slideshare.net/IanSkerrett/eclipse-survey-2013-report-final/14http://commons.wikimedia.org/wiki/File:Git-logo.svghttp://commons.wikimedia.org/wiki/File:Git-logo.svghttp://www.flickr.com/photos/amanky/3165141991/http://www.flickr.com/photos/amanky/3165141991/