Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git push rejected non-fast-forward

Tags:

git

eclipse

I have about 40,000 lines of C++ code in 12 projects. Each project has a different git. I have shell script which make the installation of my software, put the NoSQL database, create directories etc. It creates also a source directory for every project. I use the clone “git clone”

The problem:

When I have a change and make a local “commit” I cannot “push” in my main repository, Due to “git push rejected -non -fast forward”... I am the only one who has access to the files. So it is not possible “The push is failing because my refs are behind those of the remote repository.”

PS The Operating system is Linux/Ubuntu

edit 1

local

git log --graph --pretty=oneline –abbrev-commit
* 5e540fd Founder initial commit  ver 2

main

git log --graph --pretty=oneline –abbrev-commit
* 74acd89 Founder initial commit

edit 2

I just done everything using CLI instead of the eclipse. So manually I have no problems

main

git log --graph -–oneline
* 45f84ae ver 2
* 74acd89 Founder initial commit

clone

git log --graph --oneline
* 45f84ae ver 2
* 74acd89 Founder initial commit

In the first place (edit 1) I was using the eclipse in order to make a) the local commit and b) the push

Now I was use the terminal and it is working as a charm, but I don't understand yet the problem with eclipse

PS

I can not add the eclipse tag :-(

like image 487
user1675224 Avatar asked Aug 04 '13 12:08

user1675224


1 Answers

I had the bad habit to press the “commit amend” button because i wanted to have the previous commit message. I didn't realize that I actual made a amend... Now Everything work as a charm.

Thank everybody for the help :-)

like image 173
user1675224 Avatar answered Oct 29 '22 17:10

user1675224