我可以重新提交旧提交吗? [英] can i rebase old commits?

查看:143
本文介绍了我可以重新提交旧提交吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用git。 Rebase是伟大的东西。我应该在特定的早期情况下使用它。

I have just started using git. Rebase is great stuff. I should have used it in a specific earlier case.

有没有一种完全可以接受的方式来为明确提交重新提交旧提交?

is there a perfectly acceptable way to rebase old commits for the sake of clear commits?

推荐答案

您应该积极地仅对没有被推向上游的提交进行此操作。也就是说,我发现使用 git rebase -i< commit> 其中< commit> 是最简单的一个提交的id至少与你不想混淆的最新提交一样久。当你的编辑器弹出时,它将包含关于如何挤压和/或删除提交的指示。

You should positively only do this for commits that have not been pushed upstream. That said, I find it easiest to use git rebase -i <commit> where <commit> is the id of a commit that is at least as old as the newest one you do not want to mess with. When your editor pops up, it will contain instructions about how to squash and/or delete commits.

这篇关于我可以重新提交旧提交吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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