benthayer / git-gud

Wanna git gud? Then get git-gud, and git gud at git!
MIT License
401 stars 42 forks source link

Level: Basics 6 - "Rebasing Instead" #261

Open benthayer opened 3 years ago

benthayer commented 3 years ago
Rebasing Instead - Show that a rebase can also be used to merge changes together.

This level demonstrates that you can check out branches and merge them to combine their files. It doesn't make an effort to show what branches are.

The branching structure would be like this: setup.spec

1
2 (master)
3 : 1 (branch)
branch

test.spec

1
2
3' (master, branch)
master

gg solution

git rebase master
git checkout master
git merge branch

Similar to #248 and others, we would have git gud status output showing the state of the different commits

Working Directory
 intro.txt - "Once upon a time there was a princess"
 middle.txt - "She lived a fulfilling life"
 ending.txt - "And then she died"
Staging Area
 intro.txt - "Once upon a time there was a princess"
 middle.txt - "She lived a fulfilling life"
 ending.txt - "And then she died"
Commit 1
 intro.txt - "Once upon a time there was a princess"
Commit 2
 intro.txt - "Once upon a time there was a princess"
 middle.txt - "She lived a fulfilling life"
Commit 3 (master, branch)
 intro.txt - "Once upon a time there was a princess"
 ending.txt - "And then she died"