oh-my-git/levels/index/new
Federico Grau 9f1444d4c3 Make clear where blue index aura is visible
Minor wording change to make clear the blue index aura will be visible
in the file browser (and not in the tree area).
2021-02-13 17:21:01 -05:00

24 lines
810 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 of 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 around icons in the file browser!
Initially, the index is empty. To make a commit that contains a new file, we need to add it!
[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"