- Code: Select all
philosopher: ~/fgdata (master)$ git checkout topics/issue1185 # get the old branch
Checking out files: 100% (1131/1131), done.
Switched to branch 'topics/issue1185'
philosopher: ~/fgdata (topics/issue1185)$ git pull --rebase origin master # update it
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 15 (delta 12), reused 0 (delta 0)
Unpacking objects: 100% (15/15), done.
From gitorious.org:fg/fgdata
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Fix for #1185
philosopher: ~/fgdata (topics/issue1185)$ git log # check work
# looks OK, have all recent commits and mine on top
philosopher: ~/fgdata (topics/issue1185)$ git push origin master # try pushing
To git@gitorious.org:fg/fgdata.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitorious.org:fg/fgdata.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
philosopher: ~/fgdata (topics/issue1185)$ git branch -u origin/master # see if setting a upstream helps
Branch topics/issue1185 set up to track remote branch master from origin.
philosopher: ~/fgdata (topics/issue1185)$ git push origin master # try again...
# ... same output as above
philosopher: ~/fgdata (topics/issue1185)$ git remote show origin
* remote origin
Fetch URL: git@gitorious.org:fg/fgdata.git
Push URL: git@gitorious.org:fg/fgdata.git
HEAD branch: master
Remote branches:
master tracked
...
Local branch configured for 'git pull':
topics/issue1185 merges with remote master
Local ref configured for 'git push':
master pushes to master (local out of date)
This looks like it's trying to push from the local master branch (which is outdated) instead of the current branch? (In the "git remote show origin" it looks like it is only set for pulling, after setting the upstream.) How do I push to Gitorious like this?