getting rejected non fast forward issue in egit

南楼画角 提交于 2019-12-10 18:49:57

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/35983927/getting-rejected-non-fast-forward-issue-in-egit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!