From e457ed10c5b5f77d91f69cb1641c758a5756b9e4 Mon Sep 17 00:00:00 2001 From: bleeptrack Date: Tue, 5 Jan 2021 17:58:06 +0100 Subject: [PATCH] One merge level --- levels/merge/merge-abort | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 levels/merge/merge-abort diff --git a/levels/merge/merge-abort b/levels/merge/merge-abort new file mode 100644 index 0000000..0032582 --- /dev/null +++ b/levels/merge/merge-abort @@ -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...