Pergunta

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)

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top