GIT - 合并到 master 后,与 master 进行变基,从而为合并到 master 的所有文件带来冲突

问题描述 投票:0回答:1

案例:-

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 bitbucket rebase git-pull
1个回答
0
投票

git pull --rebase origin master
不会将 master 拉动并重新设置到您的分支。 你应该

  • git checkout master
  • git pull --rebase
  • git checkout -
  • git rebase master
© www.soinside.com 2019 - 2024. All rights reserved.