Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » "rejected - non-fast-forward" while pushing a new local branch to remote
"rejected - non-fast-forward" while pushing a new local branch to remote [message #1821411] Wed, 12 February 2020 17:05 Go to next message
L C is currently offline L CFriend
Messages: 17
Registered: January 2019
Junior Member
Hi,

Am getting a "rejected - non-fast-forward" error while trying to push a new local branch to remote.

What I did:
1. Created a dev-0.2 tag on the master branch. The commit used for the dev-0.2 tag is a couple of commits behind the master's HEAD (see the enclosed pic)
2. Created a new local branch dev-0.2-bugfix based on the dev-0.2 tag
3. Made a couple of commits to the dev-0.2-bugfix branch
4. Tried to push dev-0.2-bugfix branch with changes to the remote but am getting the "rejected - non-fast-forward" error.

What I expected to happen was that eGit would create a new remote dev-0.2-bugfix branch with the respective changes (see step 3 above).

Any ideas? Thanks

[Updated on: Wed, 12 February 2020 23:16]

Report message to a moderator

Re: "rejected - non-fast-forward" while pushing a new local branch to remote [message #1821432 is a reply to message #1821411] Thu, 13 February 2020 00:09 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1176
Registered: July 2009
Senior Member
Try "Push Branch..." in the repositories view
Re: "rejected - non-fast-forward" while pushing a new local branch to remote [message #1821462 is a reply to message #1821432] Thu, 13 February 2020 12:34 Go to previous messageGo to next message
L C is currently offline L CFriend
Messages: 17
Registered: January 2019
Junior Member
Still getting the "rejected - non-fast-forward" error. The following pics show what I see when trying to push the branch from the Git Repositories view:
Re: "rejected - non-fast-forward" while pushing a new local branch to remote [message #1821505 is a reply to message #1821462] Thu, 13 February 2020 18:25 Go to previous message
L C is currently offline L CFriend
Messages: 17
Registered: January 2019
Junior Member
More info:

$ git push origin dev-0.2-bugfix
To file:////var/lib/git/Test.git
! [rejected] dev-0.2-bugfix -> dev-0.2-bugfix (non-fast-forward)
error: failed to push some refs to 'file:////var/lib/git/Test.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

$ git branch
* dev-0.2-bugfix
master

$ git branch -r
origin/HEAD
origin/dev/0
origin/master

Not sure why it says "Updates were rejected because the tip of your current branch is behind hint: its remote counterpart."

dev-0.2-bugfix is a local branch, its remote counterpart does not yet exist, so how can this non-existent remote branch be behind my current branch? Actually, what I'm trying to do here is to push dev-0.2-bugfix to remote, so it would exist on the remote as a separate branch.

Any ideas? Thanks.
Previous Topic:JGit - GerritHook?
Next Topic:git-blame --contents equivalent
Goto Forum:
  


Current Time: Sun Jun 13 13:52:34 GMT 2021

Powered by FUDForum. Page generated in 0.02380 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top