如何重新添加已暂存但在暂存后修改的文件?我不想手动一一添加它们。
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: file1
modified: file2
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file1
modified: file3
这里我不想暂存 file3
。
最佳答案
结果 git update-index
有一个专门用于此目的的选项:
git update-index --again
Runs git update-index itself on the paths whose index entries are different from those from the
HEAD
commit.
来源:
关于git - 仅添加修改过的已暂存文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63729260/