Failed to push Django project on github using gitbash

61 views
Skip to first unread message

Mayur Bagul

unread,
Apr 18, 2019, 9:27:14 AM4/18/19
to Django users
Hello Community,

im using gitbash to upload my code to github but it giving below error:

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/MayurBagul/Weather-Informer.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.

i tried to use fetch and merge command but even though it is giving error.
please help me to solve this issue.

Thanking You,
Mayur Bagul.
push.PNG

Test Bot

unread,
Apr 18, 2019, 10:16:04 AM4/18/19
to django...@googlegroups.com
It means your remote has some changes that are not there in your local so when you are pushing, git is unable to merge those changes.

Try a git pull then local merge and then push. Feel free to ask in case of any queries.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a27866f8-1a92-45b9-80c4-84099df30df5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mayur Bagul

unread,
Apr 18, 2019, 10:43:19 AM4/18/19
to Django users
Hello online judge,

after getting this error i deleted that repository and created it again and did same commands in git bash but it was giving same errors.
and i also did google and as you said pull those changes i found similar answers on google but it didnt worked.
i pull, fetched, and merged also but it was giving same error again and again.

i'm not getting what i should do.

thanks for help judge.


On Thursday, April 18, 2019 at 7:46:04 PM UTC+5:30, OnlineJudge95 wrote:
It means your remote has some changes that are not there in your local so when you are pushing, git is unable to merge those changes.

Try a git pull then local merge and then push. Feel free to ask in case of any queries.

On Thu, Apr 18, 2019, 6:58 PM Mayur Bagul <mayur...@gmail.com> wrote:
Hello Community,

im using gitbash to upload my code to github but it giving below error:

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/MayurBagul/Weather-Informer.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.

i tried to use fetch and merge command but even though it is giving error.
please help me to solve this issue.

Thanking You,
Mayur Bagul.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

Joakim Hove

unread,
Apr 18, 2019, 10:50:48 AM4/18/19
to django...@googlegroups.com
> [...]  and merged also but it was giving same error again and again.

bash% git fetch origin  (assuming your remote is "origin" - which is typically the default)
bash% git merge origin/master
bash% git push origin master

If this for some reason does not work (I can not understand why it should not - but anyway) you can always force:

bash% git push -f origin master

The force (-f) will override the protection which is creating trouble for you - but before doing that; be certain you want to overwrite what is on the remote!





Reply all
Reply to author
Forward
0 new messages