d:\dev\projects\reschif\source\testrepo>git push
Counting objects: 12, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 882 bytes, done.
Total 10 (delta 8), reused 0 (delta 0)
remote: bb/acl: reschifl is allowed. accepted payload.
To g...@bitbucket.org:reschifl/testrepo.git
2676d4f..7946595 develop -> develop
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'g...@bitbucket.org:reschifl/testrepo.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
After you do 'git flow release finish…' are you 'git pushing' back to your origin both the develop, and master branches?
+ git commit -a -m Start development version 0.0.18-SNAPSHOT [develop 2676d4f] Start development version 0.0.18-SNAPSHOT 1 files changed, 1 insertions(+), 1 deletions(-) + git push remote: bb/acl: reschifl is allowed. accepted payload. [K To g...@bitbucket.org:reschifl/testrepo.git dae6478..2676d4f develop -> develop 4199e60..ea75e99 master -> master + git push --tags remote: bb/acl: reschifl is allowed. accepted payload. [K To g...@bitbucket.org:reschifl/testrepo.git * [new tag] 0.0.17 -> 0.0.17
When performing the release on my local machine, I don't see this effect.
> On the dev machine, when I go "git pull", that does a fetch and then a merge
> from origin/develop to my local develop, however origin/master doesn't been
> merged ( upstreams origin/master has been pulled into my local repo, but its
> not in my master branch yet ) so in those cases I have to switch to my
> master branch and git pull there as well.
I think I do not fully understand, what a "non-fast-forward" error is
about, but this could be the key information.
The release on the ci-server changes the master branch.
A "git pull" on my local develop branch shows, that there are changes
retrieved from origin for all branches:
> d:\dev\projects\reschif\source\testrepo>git status
> # On branch develop
> nothing to commit (working directory clean)
>
> d:\dev\projects\reschif\source\testrepo>git pull
> remote: Counting objects: 14, done.
> remote: Compressing objects: 100% (10/10), done.
> remote: Total 10 (delta 6), reused 0 (delta 0)
> Unpacking objects: 100% (10/10), done.
> From bitbucket.org:reschifl/testrepo
> 91e6a05..4ad9f80 develop -> origin/develop
> ea75e99..a3c4724 master -> origin/master
> * [new tag] 0.0.18 -> 0.0.18
> Updating 91e6a05..4ad9f80
> Fast-forward
> pom.xml | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
But it also shows that the committs on develop are merged. ("Fast-foreward...").
I don't know, if incomming changes on the master branch, which is not
checked out, also need to be merged.
> d:\dev\projects\reschif\source\testrepo>git checkout master
> Switched to branch 'master'
> Your branch is behind 'origin/master' by 10 commits, and can be fast-forwarded.
>
> d:\dev\projects\reschif\source\testrepo>git merge
> fatal: No commit specified and merge.defaultToUpstream not set.
>
> d:\dev\projects\reschif\source\testrepo>git pull
> Updating ea75e99..a3c4724
> Fast-forward
> pom.xml | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
I don't know how to call the merge on master, but a pull also worked :)
> If this is the case, then this is more a git question than git-flow itself,
> I just found a good article on the differences between pull and fetch that
> might be good reading:
>
> http://longair.net/blog/2009/04/16/git-fetch-and-merge/
>
> THe short is - a pull simply merges the CURRENT branch with its tracking
> branch, not the other branches.
Thank you for this info and the link.
For me, it looks like that this error is an expected behaviour.
So, I have to learn more about git.
Best regards,
Lars
- "git push" pushes all branches;
- but your master is outdated;
- so git won't let you push master.
Your options are:
- "git pull origin develop" only;
- "git pull"; "git co master"; "git pull" again (or just "git merge origin/master"); "git co develop"
- or just ignore the error! It doesn't affect you until/unless you actually want to use master.
:)
Aseem
2012/3/7 Aseem Kishore <aseem....@gmail.com>:
> Yes this error is merely:
>
> - "git push" pushes all branches;
> - but your master is outdated;
> - so git won't let you push master.
Thank you for the explanation.
> Your options are:
>
> - "git pull origin develop" only;
> - "git pull"; "git co master"; "git pull" again (or just "git merge origin/master"); "git co develop"
> - or just ignore the error! It doesn't affect you until/unless you actually want to use master.
I think I will use them all in this order... ;)
Regards,
Lars