can i rebase old commits?

后端 未结 2 753
故里飘歌
故里飘歌 2021-02-19 07:02

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 th

相关标签:
2条回答
  • 2021-02-19 07:34

    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.

    0 讨论(0)
  • 2021-02-19 07:47

    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.

    0 讨论(0)
提交回复
热议问题