mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-09 05:02:22 +02:00
Two top-down levels
This commit is contained in:
parent
2a890c7f8a
commit
04f4898417
9 changed files with 44 additions and 0 deletions
levels/top-down/rebase
1
levels/top-down/rebase/description
Normal file
1
levels/top-down/rebase/description
Normal file
|
@ -0,0 +1 @@
|
|||
Rebase all branches on top of the main branch, so that the commits are in alphabetical order, and then point the main branch to the top commit.
|
9
levels/top-down/rebase/goal
Normal file
9
levels/top-down/rebase/goal
Normal file
|
@ -0,0 +1,9 @@
|
|||
git switch side1
|
||||
git rebase main
|
||||
git switch side2
|
||||
git rebase side1
|
||||
git switch main
|
||||
git merge side2
|
||||
|
||||
git reflog expire --expire=all --all
|
||||
git prune
|
12
levels/top-down/rebase/start
Normal file
12
levels/top-down/rebase/start
Normal file
|
@ -0,0 +1,12 @@
|
|||
git commit --allow-empty -m A
|
||||
git commit --allow-empty -m B
|
||||
git commit --allow-empty -m C
|
||||
|
||||
git switch -c side1 main~1
|
||||
git commit --allow-empty -m D
|
||||
git commit --allow-empty -m E
|
||||
|
||||
git switch -c side2 main~2
|
||||
git commit --allow-empty -m F
|
||||
|
||||
git checkout main
|
1
levels/top-down/rebase/win
Normal file
1
levels/top-down/rebase/win
Normal file
|
@ -0,0 +1 @@
|
|||
diff <(git log --pretty=%s main) <(echo -e "F\nE\nD\nC\nB\nA")
|
Loading…
Add table
Add a link
Reference in a new issue