mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-07 05:02:04 +02:00
First version of an "index" chapter
This commit is contained in:
parent
21d8366dbb
commit
e754671b88
12 changed files with 216 additions and 6 deletions
levels/index
24
levels/index/rm
Normal file
24
levels/index/rm
Normal file
|
@ -0,0 +1,24 @@
|
|||
title = Delete a file in the next commit
|
||||
cards = add reset checkout rm commit
|
||||
|
||||
[description]
|
||||
|
||||
If you want to remove a file in the next commit, you can use `git rm`! This will both delete the file locally, and in the index.
|
||||
|
||||
If a file is modified, you'll need to reset these changes first/reset the files.
|
||||
|
||||
[setup]
|
||||
|
||||
echo a > a
|
||||
echo x > b
|
||||
echo x > c
|
||||
git add .
|
||||
git commit -m "Initial commit"
|
||||
echo x > a
|
||||
echo b > b
|
||||
git add b
|
||||
|
||||
[win]
|
||||
|
||||
# Make a commit where all files are deleted ¯\_(^_^)_/¯
|
||||
test "$(git ls-tree main | wc -l)" -eq 0
|
Loading…
Add table
Add a link
Reference in a new issue