Search code examples
fluttergitgithubgit-commit

git pull origin master not wokring


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/


Solution

  • 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".