代码之家  ›  专栏  ›  技术社区  ›  Tom Hale

为什么要避免“git-pull”以及该怎么做

  •  1
  • Tom Hale  · 技术社区  · 7 年前

    this comment , @torek (目前声誉172509)说:

    实际上我建议避免 git pull 完全是因为同样的原因你建议避免 --autostash

    这个 reason given 为了避免 git rebase --autostash 是:

    它似乎方便时,它的工作,但有问题时,它不

    在哪些方面可以 git拉 当它不起作用时会有问题吗?

    My robust automated solution to avoiding git pull --autostash is non-trivial .

    是否有可靠的自动化解决方案来避免 git拉 ?

    1 回复  |  直到 7 年前
        1
  •  1
  •   VonC    7 年前

    无需避免git拉动: since Git 2.9 ,类型:

    git config --global pull.rebase true
    git config --global rebase.autoStash true
    

    然后是一个简单的 git pull 在本质上,你的 better workflow 是关于:如果需要的话,重新设置当前分支在已获取分支之上的基础 origin/yourBranch .