我有一些更改要提交到一个文件中,已经添加(但未提交)。该文件在当前目录中有其他更改,这些更改不会被提交。但是在我实际提交之前,我需要编辑一些即将提交的更改。清除?我是这么想的!
» git status
On branch dev
Your branch is ahead of 'origin/dev' by 2 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: myfile <-- I need to edit this
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: myfile <-- I do not care about this (for this specific commit)
因此,在实际提交之前,我想更改分阶段的更改。git commit -i
让我手动编辑补丁。我可以以某种方式直接在分阶段更改上使用此功能吗?
解决此问题的另一种方法是存储非暂存更改,编辑工作目录中的文件并添加这些更改。但我的印象是,当我取消隐藏时,我会遇到冲突。