案例:-
A new branch created for given requirement
- Adding changes as per requirement in the branch and
+ Below commands executed every time we commit ->
+ git add .
+ git commit -m "comment" (committing changes to branch)
+ git pull --rebase origin master (rebase branch with master)
+ git fetch
+ git push -f origin <branch_name>
- Finally raised a pull request
- Once approved merged either normal or squashed-way
问题:-
Now here, conflicts come every time ->
- After merge to master , when again running
+ git pull --rebase origin master (rebase branch with master)
- Then its showing conflicts in all the files where changes were done and
- Its 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
如何解决这个问题 - 请建议如何避免这种情况以及方法上需要的任何改变?
git pull --rebase origin master
不会将 master 拉动并重新设置到您的分支。
你应该
git checkout master
git pull --rebase
git checkout -
git rebase master