can i rebase old commits?

吃可爱长大的小学妹 提交于 2019-12-04 00:10:09
Brian L

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.

In general, if you've shared a commit with someone else, don't rebase it.

If you haven't shared a commit with anyone else, you can do whatever you want to it.

See the "RECOVERING FROM UPSTREAM REBASE" section of the git-rebase manpage for more info.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!