mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-05 05:02:02 +02:00
Enable files' drop area, two levels about the index
This commit is contained in:
parent
a893cba9d3
commit
8760ad7178
8 changed files with 87 additions and 6 deletions
|
@ -1,10 +1,13 @@
|
|||
conflict
|
||||
init
|
||||
checkout-commit
|
||||
branching
|
||||
merge
|
||||
branches
|
||||
conflict
|
||||
pull-push
|
||||
rebase
|
||||
reorder
|
||||
bisect
|
||||
steps
|
||||
split
|
||||
sandbox
|
||||
|
|
26
levels/time-machine/split
Normal file
26
levels/time-machine/split
Normal file
|
@ -0,0 +1,26 @@
|
|||
title = Split a commit!
|
||||
cards = checkout commit reset-hard reset add rebase-interactive rebase-continue show
|
||||
|
||||
[description]
|
||||
|
||||
Here, both changes happened in one commit! Split them to be in two commits instead.
|
||||
|
||||
[setup]
|
||||
|
||||
echo something > file1
|
||||
echo something else > file2
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
|
||||
echo this should happen first >> file1
|
||||
echo and this should happen after that >> file2
|
||||
git commit -am "Both together"
|
||||
|
||||
echo this is some other change >> file1
|
||||
echo this is some other change >> file2
|
||||
git commit -am "Something else"
|
||||
|
||||
[win]
|
||||
|
||||
test "$(git diff-tree --no-commit-id --name-status -r main^)" = "M file2" &&
|
||||
test "$(git diff-tree --no-commit-id --name-status -r main~2)" = "M file1"
|
23
levels/time-machine/steps
Normal file
23
levels/time-machine/steps
Normal file
|
@ -0,0 +1,23 @@
|
|||
title = One step after another
|
||||
cards = checkout commit reset-hard add
|
||||
|
||||
[description]
|
||||
|
||||
Sometimes, you might want to record the order in which things changed, instead of making a single commit.
|
||||
|
||||
What happened here? Make two commits from the changes (using the "add" card), in an order that makes sense!
|
||||
|
||||
[setup]
|
||||
|
||||
echo something > file1
|
||||
echo something else > file2
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
|
||||
echo this should happen first >> file1
|
||||
echo and this should happen after that >> file2
|
||||
|
||||
[win]
|
||||
|
||||
test "$(git diff-tree --no-commit-id --name-status -r main)" = "M file2" &&
|
||||
test "$(git diff-tree --no-commit-id --name-status -r main^)" = "M file1"
|
Loading…
Add table
Add a link
Reference in a new issue