oh-my-git/levels/low-level/it/index-remove

29 lines
492 B
Text

[description]
To remove an entry from the index, use a command like this:
git update-index --force-remove <file>
Remove all entries from the index!
[setup]
echo "file 1" > file1
echo "file 2" > file2
echo "file 3" > file3
git add .
[setup goal]
echo "file 1" > file1
echo "file 2" > file2
echo "file 3" > file3
git add .
git update-index --force-remove file1
git update-index --force-remove file2
git update-index --force-remove file3
[win]
test "$(git ls-files | wc -l)" -eq 0