在没有Rebase的情况下重做GIT中的提交历史记录 [英] Redoing Commit History in GIT Without Rebase
问题描述
因为问起我最后一个问题,原来是关于GIT的重新配置,所以我决定我不想根本没有改变。相反,我想:
Since asking my last question which turned out to be about rebasing with GIT, I have decided that I don't want to rebase at all. Instead I want to:
- 分行
- 完成工作,检查和推送
- 抛出所有这些提交并假装他们从未发生过(所以在工作结束时一个干净的提交)
我现在通过将文件复制到一个新目录然后将它们复制回一个新分支(与我的工作分支相同的点分支),然后将它合并到主人
或任何地方。
I do this currently by copying the files to a new directory and then copying them back in to a new branch (branched at the same point as my working branch), and then merging that into master
or wherever.
这是否很简单,为什么?更重要的是:是否有更好的/ GIT的方式来做到这一点?
Is this just plain bad and why? More important: Is there a better/GIT way to do this? git rebase -i
forces me to merge (and pick, and squash).
推荐答案
您也可以使用 git merge
与 - squash
选项。
这篇关于在没有Rebase的情况下重做GIT中的提交历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!