mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-03 19:04:40 +01:00
22 lines
680 B
Text
22 lines
680 B
Text
title = Add new files to the index
|
|
cards = add commit
|
|
|
|
[description]
|
|
|
|
So far, when we made a commit, we've always recorded the current status all objects, right?
|
|
|
|
But Git allows you to pick which changes you want to put in a commit!
|
|
|
|
To learn how that works, we need to learn about the "index"! In the index, we can prepare what will be in the next commit. In this game, the index is represented by a blue aura!
|
|
|
|
[setup]
|
|
|
|
echo "The candle is burning with a blue flame." > candle
|
|
|
|
[win]
|
|
|
|
# Add the candle.
|
|
test "$(git diff --cached --name-only)" = "candle" || file -f .git/candle-added && touch .git/candle-added
|
|
|
|
# Make a commit.
|
|
test "$(git ls-tree --name-only HEAD)" = "candle"
|