-
Bug
-
Resolution: Fixed
-
High
-
None
-
4
-
Severity 2 - Major
-
70
-
Summary
Before the first push to a newly created repository, rename the local default branch from "master" to an arbitrary name i.e "test".
When you push to remote, check the UI, this error is received "The default branch is set to "refs/heads/master" but does not exist. Configure the default branch in the repository settings."
After changing the default branch to "test", when you try to clone from the mirror, you get the error "warning: remote HEAD refers to nonexistent ref, unable to checkout.", but cloning from the upstream server works fine.
Steps to reproduce
mkdir test cd test git init echo "Test word" > index.txt git add index.txt git commit -m "added index.txt" git branch -m master test git remote add origin https://upstream_server.com/scm/bpr/test.git git push --set-upstream origin test
Try to clone from the mirror
git clone https://mirror_server.com/scm/bpr/test.git Cloning into 'test'... remote: Enumerating objects: 3, done. remote: Counting objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. warning: remote HEAD refers to nonexistent ref, unable to checkout.
Workaround
Navigate to the repository in the mirror file system, and manually updated the default branch from the "HEAD" file: from ref: refs/heads/master to ref: refs/heads/test