在Git中,是否有可能仅提交已经被暂存但自上次提交以来发生过修改的文件?
例如,给定以下情况:
> 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: file2
modified: file3
能否仅使用 Git 暂存
file2
而无需指定 file2
(例如不使用 git add file2
或类似的命令)?
restage = update-index --again
- neverendingqs