Error: src refspec main does not match #22766
-
Can’t push to the main branch. Default Branch is main now. Image: https://imgur.com/a/xlf2Pcz
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Do you have a local |
Beta Was this translation helpful? Give feedback.
-
Solved by running You saved me @airtower-luna Thanks. |
Beta Was this translation helpful? Give feedback.
-
This error simply means that you don't have branch in current repo called main in your local git. but in the remote git it exist, because GitHub will create a default branch main in the repo for you . So in other to solve the error you need to create a new branch called man in your local git before you can push it to the specified origin. note that the default branch name in the local repo is "master" hence you can use master without any problems because It simply exits. but does it exist in the remote **NO ** but github will create a new branch on the remote repo called master for you. So in summary
Dont forget that this will use the default Branch called main on your remote repo but if you go with the branch named master, it will create a new branch called master on your remote repo , and leave the main default branch blank Thank you. |
Beta Was this translation helpful? Give feedback.
Do you have a local
main
branch, too? The error message sounds like you don’t.