mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
One merge level
This commit is contained in:
parent
12ea306302
commit
e457ed10c5
1 changed files with 53 additions and 0 deletions
53
levels/merge/merge-abort
Normal file
53
levels/merge/merge-abort
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
title = Merging timelines
|
||||||
|
cards = checkout commit-auto merge
|
||||||
|
|
||||||
|
[description]
|
||||||
|
|
||||||
|
Sometimes you want to merge two commits, nut a merge conflict occurs that you currently don't want to resolve.
|
||||||
|
In these situations you can abort the merge to merge later. Use
|
||||||
|
git merge --abort
|
||||||
|
when you are in a merge process.
|
||||||
|
|
||||||
|
Try to merge both commits and abort the merge afterwards.
|
||||||
|
|
||||||
|
[setup]
|
||||||
|
|
||||||
|
echo "A new day is starting" > you
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit -m "Start"
|
||||||
|
|
||||||
|
echo "Walking down the Main Lane." >> you
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit -m "Main Lane"
|
||||||
|
|
||||||
|
|
||||||
|
git checkout HEAD~1
|
||||||
|
|
||||||
|
echo "Walking down the Side Lane." >> you
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit -m "Side Lane"
|
||||||
|
|
||||||
|
git checkout HEAD~1
|
||||||
|
|
||||||
|
git branch -D main
|
||||||
|
|
||||||
|
[actions]
|
||||||
|
|
||||||
|
if test -f .git/MERGE_HEAD; then
|
||||||
|
touch .git/secretfile
|
||||||
|
fi
|
||||||
|
|
||||||
|
[win]
|
||||||
|
|
||||||
|
# You tried to merge?
|
||||||
|
test -f .git/secretfile
|
||||||
|
|
||||||
|
# You aborted to merge?
|
||||||
|
test -f .git/secretfile && ! test -f .git/MERGE_HEAD
|
||||||
|
|
||||||
|
[congrats]
|
||||||
|
|
||||||
|
Aaah, let's merge later...
|
Loading…
Reference in a new issue