문제

We're using git flow. Here is the 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

error:

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)

Why does it tell me that it's rejecting master when i'm pushing to develop (develop is a remote tracking branch if your not familiar with git flow)

도움이 되었습니까?

해결책

By default, git push tries to update all upstream branches (those matching branch.<name>.merge in your configuration).

Try this:

git config push.default tracking

This tells git to only push commits to the upstream branch matching the name of the local branch you currently have checked out.

See also

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top