代码之家  ›  专栏  ›  技术社区  ›  hades

Git处理跟踪和未跟踪文件的合并冲突

  •  1
  • hades  · 技术社区  · 6 年前

    我在这里面 develop 分公司和我结帐到新的地方分公司开发新功能。

    git checkout -b task-change-title-and-styling
    

    tracked untrack 文件夹。

    我知道不会发生合并冲突的常见做法如下:

    git add .
    git commit -m "Change titles and styling on homepage"
    git fetch origin
    git rebase origin/develop
    git push -u origin task-change-title-and-styling
    

    跟踪 untracked 文件)?

    下面是我处理合并冲突的假设,但不确定步骤是否正确

    git add .
    git commit -m "Change titles and styling on homepage"
    git fetch origin
    git rebase origin/develop
    
    *at this point i assume my git will have merge conflict message*
    

    然后修复合并冲突,然后

    git add .
    git rebase --continue
    *there are still conflict message*
    

    git add .
    git rebase --continue
    *now no more merge conflict message*
    git push -u origin task-change-title-and-styling  
    
    1 回复  |  直到 6 年前
        1
  •  1
  •   Lazar Nikolic    6 年前

    你的假设是正确的。 虽然,我从来没有在rebase之前使用git-fetch-origin,因为git-gebase-origin/development已经做了最新版本的development分支的拉取