为什么git在推送到不同的分支时拒绝主人

时间:2011-11-28 19:47:22

标签: git git-flow

我们正在使用git flow。这是流程。

  1. git flow feature start myfeat
  2. git commit -a
  3. git checkout develop
  4. git pull
  5. git flow feature checkout myfeat
  6. git flow feature rebase myfeat
  7. git flow feature finish myfeat
  8. git push
  9. 错误:

    Counting objects: 15, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (8/8), done.
    Writing objects: 100% (8/8), 820 bytes, done.
    Total 8 (delta 6), reused 0 (delta 0)
    To git@github.com:blah/blah.git
       d675b35..d35f160  develop -> develop
     ! [rejected]        master -> master (non-fast-forward)
    

    为什么它告诉我当我推动开发时它拒绝掌握(如果你不熟悉git流程,开发是一个远程跟踪分支)

1 个答案:

答案 0 :(得分:6)

默认情况下,git push会尝试更新所有上游分支(配置中与branch.<name>.merge匹配的分支)。

试试这个:

git config push.default tracking

这告诉git只将提交推送到与您当前检出的本地分支名称相匹配的上游分支。

另见

相关问题