Platform notice: Server and Data Center only.
This article only applies to Atlassian products on the
Server and Data Center platforms
.
Support for Server* products
ended on February 15th 2024
. If you are running a Server product, you can visit the
Atlassian Server end of support
announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When pushing a new repository to the Bitbucket Server, the following error is returned from the Git client:
error: src refspec master does not match any.
error: failed to push some refs to 'http://stash.company.com/scm/PROJECT/REPO.git'
Cause
This is caused by the repository still being empty. There are no commits in the repository, and thus no
master
branch to push to the server.
Resolution
Please note that recent Bitbucket releases allow customizing the default branch name, as listed in
Setting a system-wide default branch name
, you can confirm what is the default branch name before executing the
push
command.
If the resolution does not work, please get in touch with
Atlassian Support
.