New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rejected] failed to push to some refs #29

Closed
JonnyD opened this Issue Jan 28, 2014 · 61 comments

Comments

Projects
None yet
@JonnyD

JonnyD commented Jan 28, 2014

I followed the instructions correctly but then when I go to push I get this error. The repo was up to date beforehand.

! [rejected] master -> master (fetch first)
error: failed to push some refs to ''
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

@rtyley

This comment has been minimized.

Owner

rtyley commented Jan 28, 2014

Are you sure you followed the instructions exactly?

http://rtyley.github.io/bfg-repo-cleaner/#usage

The error message you're seeing is what you would see if you hadn't used the '--mirror' flag when doing the clone. To ensure you get a fully updated repo, it's best to redo your clone, this time ensuring you use '--mirror', and run The BFG again.

@JonnyD

This comment has been minimized.

JonnyD commented Jan 28, 2014

Thank you! I forgot to clone. It's working now.

@JonnyD JonnyD closed this Jan 28, 2014

@javparra

This comment has been minimized.

javparra commented May 13, 2015

Try this git command

git push origin master --force
or short of force -f

git push origin master -f

@heriipurnama

This comment has been minimized.

heriipurnama commented Oct 13, 2016

its works thanks #@javparra

@08shubhamjindal

This comment has been minimized.

08shubhamjindal commented Mar 20, 2017

its working @javparra

@qingfeng825

This comment has been minimized.

qingfeng825 commented May 13, 2017

its working thanks @javprra

@gaurang444

This comment has been minimized.

gaurang444 commented May 23, 2017

it's working nicely thanks for help @javparra

@harsimarsingh8

This comment has been minimized.

harsimarsingh8 commented May 31, 2017

it working @javparra

@suyashgulati

This comment has been minimized.

suyashgulati commented Jul 23, 2017

Thanks @javparra !

@selfxss

This comment has been minimized.

selfxss commented Aug 9, 2017

Works! Thx @javparra

@PriyankaSundar7

This comment has been minimized.

PriyankaSundar7 commented Oct 2, 2017

hey its working !!! thank you bro !!!

@sumyathlaing

This comment has been minimized.

sumyathlaing commented Nov 24, 2017

Yeah! Its works.
Thanks

@rajeshdumpeti

This comment has been minimized.

rajeshdumpeti commented Dec 22, 2017

Thank you so much @javparra

@saikumarbikki

This comment has been minimized.

saikumarbikki commented Dec 27, 2017

It's works..Thanks @javparra

@bestopensource

This comment has been minimized.

bestopensource commented Dec 28, 2017

Greate... thx a bunch!

@aslamanver

This comment has been minimized.

aslamanver commented Jan 1, 2018

Thanks Ya

@manisha-sinha01

This comment has been minimized.

manisha-sinha01 commented Jan 4, 2018

Its working thank you

@javparra

This comment has been minimized.

javparra commented Jan 4, 2018

@Anirudh0509

This comment has been minimized.

Anirudh0509 commented Jan 7, 2018

Thank you very much @javparra

@heltondenis

This comment has been minimized.

heltondenis commented Jan 9, 2018

Thanks, great solution!

@kumochan

This comment has been minimized.

kumochan commented Jan 18, 2018

thank @javparra

@namigaliyev

This comment has been minimized.

namigaliyev commented Jan 18, 2018

Thanks @javparra

1 similar comment
@tuananhbui89

This comment has been minimized.

tuananhbui89 commented Jan 19, 2018

Thanks @javparra

@chisom5

This comment has been minimized.

chisom5 commented Jan 21, 2018

this work fine for me. thanks @javparra

@mtalha91

This comment has been minimized.

mtalha91 commented Feb 5, 2018

I am having the same issue, use git remote -v to check the origin list
try changing git remote repo name by using git remote add origin1 [repo-url] and then push

@austinginder

This comment has been minimized.

austinginder commented Feb 6, 2018

Had same issue with a Beanstalk repo. Discovered by default they disable "non Fast-Forward pushes" on their end. To enable you need to check a box located https://[account-name].beanstalkapp.com/repositories/[git-repo]/edit.

@hostmakersyl

This comment has been minimized.

hostmakersyl commented Mar 21, 2018

Thanks. It;'s working

@f97

This comment has been minimized.

f97 commented Apr 8, 2018

Its works, thanks for #@javparra

@Velimir10

This comment has been minimized.

Velimir10 commented Apr 9, 2018

i found this helpfull, thanks!

@katoB

This comment has been minimized.

katoB commented Apr 18, 2018

@javparra Thanks

@RedhwanGhailan

This comment has been minimized.

RedhwanGhailan commented Apr 23, 2018

@javparra thanks so much

@tsainte

This comment has been minimized.

tsainte commented Apr 26, 2018

I had the same problem, using bitbucket. Solved after the --force, but I'm still wondering why it needs to be forced. Thanks anyway! <3

@Eazybright

This comment has been minimized.

Eazybright commented Apr 28, 2018

Thanks
i had the same issue but it has bn fixed

@anandtiwari767

This comment has been minimized.

anandtiwari767 commented Apr 29, 2018

thanks @javparra

@fathiafrazna

This comment has been minimized.

fathiafrazna commented May 9, 2018

thanks @javparra ^^

@titiarimba

This comment has been minimized.

titiarimba commented May 9, 2018

thanks. it works with me! ><

@mjasimuddin

This comment has been minimized.

mjasimuddin commented May 19, 2018

Thanks @javparra
It's working

@uid01themener

This comment has been minimized.

uid01themener commented May 22, 2018

Thanks @javparra
It's working

@YuvrajKhavad

This comment has been minimized.

YuvrajKhavad commented Jun 6, 2018

Working perfect thank @javparra

@Paul-uk2

This comment has been minimized.

Paul-uk2 commented Jun 25, 2018

It's working, thanks for the help @javparra

@salis77

This comment has been minimized.

salis77 commented Jul 2, 2018

special thanks! it working for me! @javparra

@BamdadNouri

This comment has been minimized.

BamdadNouri commented Jul 3, 2018

Thanks man @javparra

@Michaelxk

This comment has been minimized.

Michaelxk commented Aug 2, 2018

thanks broth you save my night!

@ardiansah21

This comment has been minimized.

ardiansah21 commented Aug 3, 2018

thank you so much @javparra

@niteshthakur498

This comment has been minimized.

niteshthakur498 commented Aug 5, 2018

Its working Thank you so much @javparra

@maibono

This comment has been minimized.

maibono commented Aug 7, 2018

thanks @javparra

@maibono

This comment has been minimized.

maibono commented Aug 7, 2018

@javparra most don't know the difference between adding mirror and without mirror can you please add it in documentation in the website that adding mirror is important

@Jaseemck

This comment has been minimized.

Jaseemck commented Aug 15, 2018

Atlast it worked....Thanks alot @javparra. Can you explain what went wrong?

@mic7x4

This comment has been minimized.

mic7x4 commented Aug 17, 2018

@javparra thanks thanks thanks

@Kirul

This comment has been minimized.

Kirul commented Aug 23, 2018

Thank you git push origin master --force worked @javparra

@fadlyansy

This comment has been minimized.

fadlyansy commented Aug 24, 2018

thank you it helps me @javparra

@Fiatinnovations

This comment has been minimized.

Fiatinnovations commented Sep 3, 2018

Thanks.

@AndrewAlizaga

This comment has been minimized.

AndrewAlizaga commented Sep 3, 2018

3 years later and still... thanks @javparra

@richa031

This comment has been minimized.

richa031 commented Sep 8, 2018

@javparra thank you so much this does works but can anybody explain why that error was coming?

@ADAM111993

This comment has been minimized.

ADAM111993 commented Sep 12, 2018

still works.......thx

@Kullay

This comment has been minimized.

Kullay commented Sep 13, 2018

it's working Thank you @javparra .but can anyone explain why that error was showing?

@jawadahmad777

This comment has been minimized.

jawadahmad777 commented Oct 2, 2018

Hi guys, I also have a kind of similar problem
$ git push -u origin master

error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/xyzzzz.git'

@restu1234

This comment has been minimized.

restu1234 commented Oct 3, 2018

Try this git command

git push origin master --force
or short of force -f

git push origin master -f

thanks, with this command, my problem solved, :-)

@irshadmv21

This comment has been minimized.

irshadmv21 commented Oct 4, 2018

thanks @javparra its working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment