bsethi24
bsethi24

Reputation: 99

After merge to master, rebase with master giving conflicts for all files merged to master

Case

A new branch created for given requirement

Problem

Now here, conflicts come every time:

How to resolve this

Please advice how to avoid this and any change required in approach?

Upvotes: 0

Views: 96

Answers (2)

bsethi24
bsethi24

Reputation: 99

Problem

After merge to master, when again on same branch running

  • git pull --rebase origin master (rebase branch with master)
  • Then it’s showing conflicts in all the files where changes were done and
  • It’s not getting resolved in one go and
  • Need to make the changes again and again in the files for the count of commits and
  • Then only rebase is getting successful

Solution: After multiple tries, found below approach solving this ->

After merge to master, if we need to add more changes in same branch

Then i tried below steps and above problem not appeared again ->

  1. After merge to master, add more changes in same branch
  2. git add .
  3. git commit
  4. Now instead of git pull --rebase origin master, execute git pull origin master
  5. git fetch
  6. Now, if we execute git pull --rebase origin master then above stated problem will not arise
  7. git push

Upvotes: 0

ErrorAndTrial
ErrorAndTrial

Reputation: 1

git pull --rebase origin master is not pulling and rebasing master to your branch. You should

  • git checkout master
  • git pull --rebase
  • git checkout -
  • git rebase master

Upvotes: 0

Related Questions