ctdo/Vorträge/git/first_steps/6_branches.md

1.2 KiB

!SLIDE center

Branches

branching

!SLIDE commandline incremental

$ git branch newbranch
$ git checkout newbranch
Switched to branch 'newbranch'
$ git branch
  master
* newbranch

!SLIDE commandline

$ git branch newbranch ← legt neue Datei an
$ git checkout newbranch
Switched to branch 'newbranch'
$ git branch
  master
* newbranch

!SLIDE commandline

$ git branch newbranch
$ git checkout newbranch ← Änderungen im akt. Verzeichnis
Switched to branch 'newbranch'
$ git branch
  master
* newbranch

!SLIDE commandline

$ git checkout -b newbranch
Switched to branch 'newbranch'

!SLIDE center

parent snapshot

!SLIDE center

branched snapshot

!SLIDE commandline

$ echo "another line" >> README
$ git commit -am 'another commit'
...
$

!SLIDE center

branched head

!SLIDE center

branched newcommit

!SLIDE center

Merging

!SLIDE command

$ git checkout master
$ git merge newbranch

!SLIDE command

$ git branch -d newbranch