0

I am getting confused between merge and rebase; I have a branch on which I did work, and also changes in master, for other areas of my project. Now I would like to get my branch to the latest master changes; but I do not want to put my branch changes into master.

Basically I am trying to update my branch to the latest code in master (there will be no conflict since I am touching different folders in the branch and in master), so I can continue on my branch but using the latest improvements that I made to the master.

Should I run a merge or should I rebase?

EDIT I am not asking which is better, but what would fit in my case; the other question is terrific to describe the difference, but does not help me to figure out what should I do.

1 Answers1

0

Rebasing or remerging in your case will not create any issues.

You should not rebase when :

  1. You have pushed the branch other than master to the remote repository. This would mean you should push your changes in the forced mode to the remote location. If someone else has already pulled this branch, they again should pull the changes in a forced mode. Basically in this case rebase is a strict no no.
  2. When you do not want to rewrite git history

You could consider using rebase when :

  1. You want the git history to be a perfect tree

If you have not pushed the branch to remote, try rebase once.

Abdus Khazi
  • 453
  • 3
  • 17