Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Should I rebase or merge conflicts?

Varun Sreenivas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 21, 2023

Hello folks, 

What are your thoughts on merging vs rebasing? If I am the only person working on a feature branch, is it okay if I rebase my branch onto main/demo or do you recommend that I merge my feature branch into main/demo instead?


I have read this article here - https://www.atlassian.com/git/tutorials/merging-vs-rebasing

Per the article, the golden rule of git rebase is to never use it on public branches. What does a public branch mean? For e.g. - Is the master/demo branch (restricted to a particular team) which is being worked on multiple people considered a public branch

1 answer

1 vote
Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 21, 2023

Hello Varun,

yes - follow the golden rule, i.e. don't rebase a (public) branch that is visible to others onto _your_ (private) branch.

And, as you are mentioning merge conflicts, even if you follow the golden rule of re-basing, you will still need to resolve conflicts, in case the same files and lines have changed in public and feature branch and git cannot resolve the changes. In fact, previously resolved merge conflicts may appear again if you perform another rebase later.

We use git-merge to resolve merge conflicts, i.e. merge the main into a feature branch, resolve conflicts and commit the feature branch.  

We have published 2 articles in this community that elaborate on git merge and rebase in detail (see links below).

Cheers, Ulrich

// Izymes

 

[1] https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Advanced-Git-merge-conflict-resolution-techniques/ba-p/2476971

[2] https://community.atlassian.com/t5/Bitbucket-articles/Alternatives-to-Git-merge-Git-s-Rebase-and-Cherry-pick/ba-p/2482241

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events