CSE306 Brief Branch & Merge git tutorial Dr. Carl Alphonce - - PowerPoint PPT Presentation

cse306 brief branch merge git tutorial
SMART_READER_LITE
LIVE PREVIEW

CSE306 Brief Branch & Merge git tutorial Dr. Carl Alphonce - - PowerPoint PPT Presentation

CSE306 Brief Branch & Merge git tutorial Dr. Carl Alphonce alphonce@buffalo.edu 343 Davis Hall Branching and merging in git commit commit commit master 1 2 3 HEAD Starting point: a sequence of commits all in the master branch.


slide-1
SLIDE 1

CSE306 Brief Branch & Merge git tutorial

  • Dr. Carl Alphonce

alphonce@buffalo.edu 343 Davis Hall

slide-2
SLIDE 2

Branching and merging in git

Starting point: a sequence of commits all in the master branch.

commit 1 commit 2 commit 3

master

HEAD

slide-3
SLIDE 3

Branching and merging in git

Create a new branch named 'bugfix':

git branch bugfix

commit 1 commit 2 commit 3

master

HEAD

bugfix

slide-4
SLIDE 4

Branching and merging in git

Move HEAD to new branch

git checkout bugfix

commit 1 commit 2 commit 3

master

HEAD

bugfix

slide-5
SLIDE 5

Branching and merging in git

Make a commit on bugfix branch

commit 1 commit 2 commit 3

master

HEAD

bugfix

commit 4

slide-6
SLIDE 6

Branching and merging in git

Make another commit on bugfix branch

commit 1 commit 2 commit 3

master

HEAD

bugfix

commit 4 commit 5

slide-7
SLIDE 7

Branching and merging in git

Check out master again:

git checkout master

commit 1 commit 2 commit 3

master

HEAD

bugfix

commit 4 commit 5

slide-8
SLIDE 8

Branching and merging in git

Merge bugfix into master:

git merge bugfix

Since no other commits were made to master in between this merge is straightforward.

commit 1 commit 2 commit 3

master

HEAD

bugfix

commit 4 commit 5