Rahul Raj
Rahul Raj

Reputation: 3459

How to commit code changes from Eclipse to GitHub

I tried committing the entire project folder to my Github repository: https://github.com/rahul-raj/SpringBoot

enter image description here

However when I try "Commit and Push", I get "master rejected non fast forward" error:

enter image description here

I tried pull/fetch, but it doesn't work either, getting "nothing to fetch" error:

enter image description here

When I try to commit and push the projects, now it says "0 Changes to be committed", but there are no such projects uploaded to my Github repository. Can someone tell me how to fix this and push the project to my Github? I was looking into several related Stack Overflow posts and nothing fixes my issue. How can I fix this through STS/EFclipse itself?

Upvotes: 0

Views: 3207

Answers (1)

howlger
howlger

Reputation: 34165

Probably your local history differs from the already existing remote history (e. g. caused by an amend commit to an already pushed commit).

In this case, in the Push Branch dialog you have to select the option Force overwrite branch in remote if it exists and has diverged. Maybe you need to allow force push in your GitHub repository first.

Upvotes: 1

Related Questions