mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-26 20:33:20 +01:00
22 lines
383 B
Text
22 lines
383 B
Text
title = Resetting files in the index
|
|
cards = add reset
|
|
|
|
[description]
|
|
|
|
If you already have changes in the index, but want to reset them, you can use `git reset`!
|
|
|
|
[setup]
|
|
|
|
echo a > a
|
|
echo b > b
|
|
echo c > c
|
|
git add .
|
|
git commit -m "Initial commit"
|
|
echo x > a
|
|
echo x > b
|
|
git add .
|
|
|
|
[win]
|
|
|
|
# Reset all changes in files in the index!
|
|
test "$(git diff --cached --name-only | wc -l)" -eq 0
|