Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting rejected non fast forward issue in egit

Tags:

git

eclipse

egit

I have done checkout from branch 2.0 .

Now I made changes to one of the file.
I want to commit it to branch i.e 2.0 branch,
So I right click on file , select team->commit option I ask me to select branch .

So I selected 2.0 and repository url. When I click , commit & push , on next box ,it is giving me confirmation box with expected push result as 2.0 [rejected-non-fast-forward].

Is it because of I am in develop group not in master ?
Also I able to changes on my local commit, but it is not reflected in master copy so is their any way to commit it to master copy.

Attached screenshot of confirm box.

enter image description here

like image 317
achan1989 Avatar asked Jan 07 '23 11:01

achan1989


2 Answers

I face same problem in My Eclipse Project and I tried Pull the all commit and than retry to push

enter image description here

like image 198
Maulik Patel Avatar answered Jan 11 '23 02:01

Maulik Patel


Yep.

You try to push code from branch different to master and you cant.

How to fix it?

# commit all your changes to the desired branch (develop is i understand you correctly)

# checkout the master branch
git checkout master

# merge the changes from develop into master
git merge develop

# now push the changes
git push origin master.

The git merge created a new merge commit and now you can push it back to master.

like image 34
CodeWizard Avatar answered Jan 11 '23 02:01

CodeWizard