Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Shivamyadav's avatar

repository error? Bitbucket..

I tried to push the code to the repository but failed error is here..

$ git push origin master
error: src refspec master does not match any
0 likes
9 replies
tykus's avatar

Is the remote branch named main? git branch -r will list the remote branches

tykus's avatar

@Shivamyadav there are no remote branches. Is this a completely new remote repo?

You can just push creating the remote branch from the current branch using:

git push origin HEAD
Shivamyadav's avatar

@tykus yeah, this cmd also gives same error

git push origin HEAD error: failed to push some refs to 'bitbucket.org:shivamyadav4046/school-management-project.git'

Please or to participate in this conversation.