- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2020-09-01T07:21:22+09:00","default:ryuichi","ryuichi")
#author("2020-09-01T07:23:43+09:00","default:ryuichi","ryuichi")
* git addの取消し [#wde3ef9b]
** ここでのgit addの取消しとは? [#za1f5fef]
- '''git add'''してステージしたファイルをINDEXから削除する
- その際、ファイル自体はワーキングディレクトリから削除しない
** 手順 [#y46e46fb]
> git add 1.txt
> git add 1.txt # (1)
> git status
## master
A 1.txt
> git rm --cached 1.txt
> git rm --cached 1.txt # (2)
rm '1.txt'
> git status # (3)
## master
?? 1.txt
- (1) 1.txtをgit addする
- (2) git rm --cachedでそのgit addを取り消す
- (3) INDEXから削除されたが、ファイル自体は存在している