Git Product home page Git Product logo

Comments (275)

javparra avatar javparra commented on May 22, 2024 2992

Try this git command

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

git push origin master -f

from bfg-repo-cleaner.

rtyley avatar rtyley commented on May 22, 2024 138

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.

from bfg-repo-cleaner.

heriipurnama avatar heriipurnama commented on May 22, 2024 66

its works thanks #@javparra

from bfg-repo-cleaner.

08shubhamjindal avatar 08shubhamjindal commented on May 22, 2024 31

its working @javparra

from bfg-repo-cleaner.

gaurang444 avatar gaurang444 commented on May 22, 2024 12

it's working nicely thanks for help @javparra

from bfg-repo-cleaner.

harsimarsingh8 avatar harsimarsingh8 commented on May 22, 2024 12

it working @javparra

from bfg-repo-cleaner.

mtalha91 avatar mtalha91 commented on May 22, 2024 11

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 origin [repo-url] and then push

from bfg-repo-cleaner.

qingfeng825 avatar qingfeng825 commented on May 22, 2024 9

its working thanks @javprra

from bfg-repo-cleaner.

suyashgulati avatar suyashgulati commented on May 22, 2024 7

Thanks @javparra !

from bfg-repo-cleaner.

aslamanver avatar aslamanver commented on May 22, 2024 5

Thanks Ya

from bfg-repo-cleaner.

austinginder avatar austinginder commented on May 22, 2024 5

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.

from bfg-repo-cleaner.

sumyathlaing avatar sumyathlaing commented on May 22, 2024 4

Yeah! Its works.
Thanks

from bfg-repo-cleaner.

rajeshdumpeti avatar rajeshdumpeti commented on May 22, 2024 4

Thank you so much @javparra

from bfg-repo-cleaner.

bestopensource avatar bestopensource commented on May 22, 2024 4

Greate... thx a bunch!

from bfg-repo-cleaner.

manisha-sinha01 avatar manisha-sinha01 commented on May 22, 2024 4

Its working thank you

from bfg-repo-cleaner.

Anirudh0509 avatar Anirudh0509 commented on May 22, 2024 4

Thank you very much @javparra

from bfg-repo-cleaner.

namigaliyev avatar namigaliyev commented on May 22, 2024 4

Thanks @javparra

from bfg-repo-cleaner.

chisom5 avatar chisom5 commented on May 22, 2024 4

this work fine for me. thanks @javparra

from bfg-repo-cleaner.

selfxss avatar selfxss commented on May 22, 2024 3

Works! Thx @javparra

from bfg-repo-cleaner.

PriyankaSundar7 avatar PriyankaSundar7 commented on May 22, 2024 3

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

from bfg-repo-cleaner.

heltondenis avatar heltondenis commented on May 22, 2024 3

Thanks, great solution!

from bfg-repo-cleaner.

kumochan avatar kumochan commented on May 22, 2024 3

thank @javparra

from bfg-repo-cleaner.

saikumarbikki avatar saikumarbikki commented on May 22, 2024 2

It's works..Thanks @javparra

from bfg-repo-cleaner.

tuananhbui89 avatar tuananhbui89 commented on May 22, 2024 2

Thanks @javparra

from bfg-repo-cleaner.

hostmakersyl avatar hostmakersyl commented on May 22, 2024 2

Thanks. It;'s working

from bfg-repo-cleaner.

f97-2308 avatar f97-2308 commented on May 22, 2024 2

Its works, thanks for #@javparra

from bfg-repo-cleaner.

restu1234 avatar restu1234 commented on May 22, 2024 2

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, :-)

from bfg-repo-cleaner.

behnood-eghbali avatar behnood-eghbali commented on May 22, 2024 2

Jackpot!!!

from bfg-repo-cleaner.

Velimir10 avatar Velimir10 commented on May 22, 2024 1

i found this helpfull, thanks!

from bfg-repo-cleaner.

michaelDnguyen avatar michaelDnguyen commented on May 22, 2024 1

it's working nicely, thanks idea @javparra

from bfg-repo-cleaner.

anshu300 avatar anshu300 commented on May 22, 2024 1

follow this method step by step

1.git init
2.git config user.name "someone"
3.git config user.email "[email protected]"
4.git add *
5.git commit -m "some init msg"

from bfg-repo-cleaner.

gnsalok avatar gnsalok commented on May 22, 2024 1

error: failed to push some refs to ''
This will happen when someone tries to push the files before committing

from bfg-repo-cleaner.

fabellonnoe avatar fabellonnoe commented on May 22, 2024 1

git push origin master -f

But I highly recommend that you must not push to the master.
Better create your own branch and make your changes there
and push your changes to your branch like this

git add -A (to save your changes to stage)

git commit -m "Your commit message eg.(Able to login)" ( to commit your changes)'

git push origin branchname (to push it your repository)

and create merge request(gitlab)/pull request(github) and let your lead to code review and merge it to the master :)

if your tech lead wants you to correct something in your branch, go to your branch and correct it.
to push the changes to your your branch in gitlab

git add -A (to save your additional changes)

git --amend ( to add your changes to your first commit 'Able to login')

git push origin branchname -f (to push your additional changes to the repository)

from bfg-repo-cleaner.

Jadamoureen avatar Jadamoureen commented on May 22, 2024 1

git push --set -f origin master

worked for me

from bfg-repo-cleaner.

JonnyD avatar JonnyD commented on May 22, 2024

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

from bfg-repo-cleaner.

javparra avatar javparra commented on May 22, 2024

from bfg-repo-cleaner.

LlapitanChris avatar LlapitanChris commented on May 22, 2024

@javparra thanks for the advice. now working.

from bfg-repo-cleaner.

katoB avatar katoB commented on May 22, 2024

@javparra Thanks

from bfg-repo-cleaner.

RedhwanGhailan avatar RedhwanGhailan commented on May 22, 2024

@javparra thanks so much

from bfg-repo-cleaner.

tsainte avatar tsainte commented on May 22, 2024

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

from bfg-repo-cleaner.

Eazybright avatar Eazybright commented on May 22, 2024

Thanks
i had the same issue but it has bn fixed

from bfg-repo-cleaner.

anandtiwari767 avatar anandtiwari767 commented on May 22, 2024

thanks @javparra

from bfg-repo-cleaner.

fathiafrazna avatar fathiafrazna commented on May 22, 2024

thanks @javparra ^^

from bfg-repo-cleaner.

titiarimba avatar titiarimba commented on May 22, 2024

thanks. it works with me! ><

from bfg-repo-cleaner.

mjasimuddin avatar mjasimuddin commented on May 22, 2024

Thanks @javparra
It's working

from bfg-repo-cleaner.

uid01themener avatar uid01themener commented on May 22, 2024

Thanks @javparra
It's working

from bfg-repo-cleaner.

YuvrajKhavad avatar YuvrajKhavad commented on May 22, 2024

Working perfect thank @javparra

from bfg-repo-cleaner.

Paul-uk2 avatar Paul-uk2 commented on May 22, 2024

It's working, thanks for the help @javparra

from bfg-repo-cleaner.

alisalmabadi avatar alisalmabadi commented on May 22, 2024

special thanks! it working for me! @javparra

from bfg-repo-cleaner.

BamdadNouri avatar BamdadNouri commented on May 22, 2024

Thanks man @javparra

from bfg-repo-cleaner.

Michaelxk avatar Michaelxk commented on May 22, 2024

thanks broth you save my night!

from bfg-repo-cleaner.

ardiansah21 avatar ardiansah21 commented on May 22, 2024

thank you so much @javparra

from bfg-repo-cleaner.

niteshthakur498 avatar niteshthakur498 commented on May 22, 2024

Its working Thank you so much @javparra

from bfg-repo-cleaner.

maibono avatar maibono commented on May 22, 2024

thanks @javparra

from bfg-repo-cleaner.

maibono avatar maibono commented on May 22, 2024

@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

from bfg-repo-cleaner.

Jaseemck avatar Jaseemck commented on May 22, 2024

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

from bfg-repo-cleaner.

mic7x4 avatar mic7x4 commented on May 22, 2024

@javparra thanks thanks thanks

from bfg-repo-cleaner.

Kirul avatar Kirul commented on May 22, 2024

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

from bfg-repo-cleaner.

fadlyansy avatar fadlyansy commented on May 22, 2024

thank you it helps me @javparra

from bfg-repo-cleaner.

Fiatinnovations avatar Fiatinnovations commented on May 22, 2024

Thanks.

from bfg-repo-cleaner.

AndrewAlizaga avatar AndrewAlizaga commented on May 22, 2024

3 years later and still... thanks @javparra

from bfg-repo-cleaner.

richa031 avatar richa031 commented on May 22, 2024

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

from bfg-repo-cleaner.

ADAM111993 avatar ADAM111993 commented on May 22, 2024

still works.......thx

from bfg-repo-cleaner.

Kullay avatar Kullay commented on May 22, 2024

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

from bfg-repo-cleaner.

jawadahmad777 avatar jawadahmad777 commented on May 22, 2024

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'

from bfg-repo-cleaner.

irshadmv21 avatar irshadmv21 commented on May 22, 2024

thanks @javparra its working

from bfg-repo-cleaner.

digit2018 avatar digit2018 commented on May 22, 2024

Hi guys please help ,

ANNET@ANN MINGW64 ~/........../.....(master)
$ git push origin master
error: src refspec master does not match any.
error: failed to push some refs to 'ssh://github.com/............../..............git'

from bfg-repo-cleaner.

triabagus avatar triabagus commented on May 22, 2024

thanks yo . javara

from bfg-repo-cleaner.

hamid97m avatar hamid97m commented on May 22, 2024

thanks it's work !!

from bfg-repo-cleaner.

LotfiBoukhemerra avatar LotfiBoukhemerra commented on May 22, 2024

thanks its works 100%
@javparra

from bfg-repo-cleaner.

vikas36714 avatar vikas36714 commented on May 22, 2024

Try this git command

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

git push origin master -f

great job bro

from bfg-repo-cleaner.

VadymVolin avatar VadymVolin commented on May 22, 2024

it's working)thank u so much @javparra

from bfg-repo-cleaner.

MachireddyRavindraReddy avatar MachireddyRavindraReddy commented on May 22, 2024

It's working. Thank you so much @javparra

from bfg-repo-cleaner.

malli1232 avatar malli1232 commented on May 22, 2024

Great!!! It's working. Thanks alot!!!!

from bfg-repo-cleaner.

Darwin325 avatar Darwin325 commented on May 22, 2024

Thanks @javparra the command is perfect.

from bfg-repo-cleaner.

yuhanzhu avatar yuhanzhu commented on May 22, 2024

Works! Thanks a lot! @javparra

from bfg-repo-cleaner.

poinck avatar poinck commented on May 22, 2024

Even after ensuring I have cloned with --mirror, I get the error:

 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]'

Edit and solved: I needed to "unprotect" the master branch at GitLab; after that git push worked

from bfg-repo-cleaner.

awais-ijaz-brainx avatar awais-ijaz-brainx commented on May 22, 2024

Write this command on terminal
git push origin master --force
This means you are forcing code to push on remote and this works for me hopefully it will work for you as well

from bfg-repo-cleaner.

eromoe avatar eromoe commented on May 22, 2024

If you got

 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://git*****'

You need unprotect the branch,

Refer to https://docs.gitlab.com/ee/user/project/protected_branches.html

Navigate to your project’s Settings ➔ Repository
Scroll to find the Protected branches section.
From the Branch dropdown menu, select the branch you want to protect and click Protect.
In the screenshot below, we chose the develop branch.

from bfg-repo-cleaner.

kntszmlk avatar kntszmlk commented on May 22, 2024

thank you so much @javparra

from bfg-repo-cleaner.

Amoldreamer avatar Amoldreamer commented on May 22, 2024

thank you very much @javparra

from bfg-repo-cleaner.

saketgupta1008 avatar saketgupta1008 commented on May 22, 2024

Thanks @javparra

from bfg-repo-cleaner.

cooldeeparmar avatar cooldeeparmar commented on May 22, 2024

Thanks @javparra

from bfg-repo-cleaner.

johngoff18 avatar johngoff18 commented on May 22, 2024

Thanks it worked @javparra

from bfg-repo-cleaner.

vinirafaelsch avatar vinirafaelsch commented on May 22, 2024

Thanks @javparra, its working!

from bfg-repo-cleaner.

taolaolatao avatar taolaolatao commented on May 22, 2024

Thanks So much @javparra

from bfg-repo-cleaner.

albertoabreu91 avatar albertoabreu91 commented on May 22, 2024

@javparra Hola Javier, me ha funcionado perfectamente pero me podrias explicar brevemente el origen de este error, y si tengo que hacer esto cada vez que quiera hacer un push? muchas gracias

from bfg-repo-cleaner.

deepa-g avatar deepa-g commented on May 22, 2024

Thanks it worked @javparra

from bfg-repo-cleaner.

zinmyoswe avatar zinmyoswe commented on May 22, 2024

Thank again @javparra

from bfg-repo-cleaner.

RajeshThakur1 avatar RajeshThakur1 commented on May 22, 2024

Ya it's working

from bfg-repo-cleaner.

facusanchez1298 avatar facusanchez1298 commented on May 22, 2024

@javparra i've serch all the day, you really save me, thank you!! (sorry if i write something wrong i dont speak inglish jajaj)

from bfg-repo-cleaner.

javparra avatar javparra commented on May 22, 2024

from bfg-repo-cleaner.

jayantosen avatar jayantosen commented on May 22, 2024

@javparra : Thanks that worked, but I have lost the other files from master. Is there any way to retain the old files and just push the new file to the master?
Yes the option is obviously we can create a pull request again from another branch but is there any way to retain the other files in master instead of following pull request procedure.

from bfg-repo-cleaner.

selamawitTad avatar selamawitTad commented on May 22, 2024

Works! Thanks a lot! @javparra

from bfg-repo-cleaner.

aarifali avatar aarifali commented on May 22, 2024

$ git push origin master --force
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/aarifali/sampleweblogin.git'

from bfg-repo-cleaner.

fabellonnoe avatar fabellonnoe commented on May 22, 2024

@javparra : Thanks that worked, but I have lost the other files from master. Is there any way to retain the old files and just push the new file to the master?
Yes the option is obviously we can create a pull request again from another branch but is there any way to retain the other files in master instead of following pull request procedure.

yes

git reset --soft HEAD~1

from bfg-repo-cleaner.

wind-s avatar wind-s commented on May 22, 2024

git push --set -f origin master

worked for me

thanks, it worked for me!

from bfg-repo-cleaner.

lephap999 avatar lephap999 commented on May 22, 2024

"git push origin master -f" work correctly, thanks !

from bfg-repo-cleaner.

CodeByNick avatar CodeByNick commented on May 22, 2024

git push --set -f origin master worked for me! Thanks

from bfg-repo-cleaner.

elirehema avatar elirehema commented on May 22, 2024

This also can happen in git push --set-upstream origin new-branch if a new-branch name contain typo or mistype

from bfg-repo-cleaner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.