You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.