-1

Whenever i try to push my git that is when i use "git push -u origin master" this command I get "error: src refspec master does not match any error: failed to push some refs to 'https://github.com/Username/gitname' "

I tried "git pull origin master" and ran into "fatal: couldn't find remote ref master" this error which i found here https://www.freecodecamp.org/news/error-failed-to-push-some-refs-to-how-to-fix-in-git/

Afnan
  • 5
  • 3
  • https://stackoverflow.com/search?q=%5Bgit%5D+error%3A+src+refspec+master+does+not+match+any – phd Aug 09 '23 at 10:20

1 Answers1

1

The push does not work because it seems like there is no branch named "master" in your local repository. Try just git push -u origin (so without ref name), then Git will push will default to the current branch. Alternatively, check the name or your current branch (git branch) and then do git push -u origin <branchname>.

Similarly, I suppose the pull does not work because the remote does not contain a branch named "master".

dillz
  • 71
  • 2