Git 交互式变基重写提交
Git interactive rebase rewrite commit
我想使用交互式变基编辑提交。当我用 edit 替换 pick 时,此提交的更改仍应用于 repo(以便我可以编辑提交)但我想从头开始重写它。我该怎么做?
在交互式变基期间编辑提交后,您应该能够将其状态检出到父提交(这意味着工作树将反映提交更改应用之前的状态)
cd /path/to/repo/root/folder
git checkout @~ -- .
# make additional changes
git commit -m "rewrite commit"
git rebase --continue
我想使用交互式变基编辑提交。当我用 edit 替换 pick 时,此提交的更改仍应用于 repo(以便我可以编辑提交)但我想从头开始重写它。我该怎么做?
在交互式变基期间编辑提交后,您应该能够将其状态检出到父提交(这意味着工作树将反映提交更改应用之前的状态)
cd /path/to/repo/root/folder
git checkout @~ -- .
# make additional changes
git commit -m "rewrite commit"
git rebase --continue