简体   繁体   中英

git rebase --continue vs. new commit

If I run into merge errors, I usually solve the merge errors, add my files again and use git rebase --continue
to continue with pulling and pushing.

Now I had some time to take a deeper look into how git works and figured out, that it should be possible to create a new commit instead. I think, thats maybe a good idea to clarify that there were some merge errors and that they were solved manually.

So which one is recommed to use and what are their both advantages and disadvantages? Thanks in advance!

Just use git rebase --continue . Resolving conflicts is an expected part of rebasing. You're throwing away the old commit that actually caused the conflict, so I don't see any benefit in recording its resolution separately.

To add to the other answer , your two options are rebase and merge.

Rebase is good when you're working alone on a feature, or specifically need to be replaying your changes ontop of the latest master.

Merge is good when you're working with other people, as rebasing rewrites the history and makes that collaboration difficult or downright impossible.

A quick rebase ( git pull --rebase ) is also handy if your changes are frequently pushed (as are those of other people) and you want to ensure your git history is cleaner and easier to follow in visual tools such as gitg or the git log --graph view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM