👋
git add を取り消す
いつもやり方を忘れるので覚書。
git rm --cached <file>
で取り消しできます。
# ファイルを追加
$ git add 20240219122324.md
$ git status
ブランチ master
Your branch is up to date with 'origin/master'.
コミット予定の変更点:
(use "git restore --staged <file>..." to unstage)
new file: 20240219122324.md
# add を取り消し
$ git rm --cached 20240219122324.md
rm 'articles/20240219122324.md'
# add がなかったことになる
$ git status
ブランチ master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
Discussion