在没有Rebase的情况下重做GIT中的提交历史记录 [英] Redoing Commit History in GIT Without Rebase

查看:171
本文介绍了在没有Rebase的情况下重做GIT中的提交历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为问起我最后一个问题,原来是关于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:


  1. 分行

  2. 完成工作,检查和推送

  3. 抛出所有这些提交并假装他们从未发生过(所以在工作结束时一个干净的提交)

我现在通过将文件复制到一个新目录然后将它们复制回一个新分支(与我的工作分支相同的点分支),然后将它合并到主人或任何地方。

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的方式来做到这一点? git rebase -i 强制我合并(并选择和压扁)。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆