You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a template repository whose default branch is named "main" instead of "master". When I create a new repository from this template, ticking "Git Content (Default Branch)", the HEAD is set incorrectly on the server:
When cloning, I get the notice "warning: remote HEAD refers to nonexistent ref, unable to checkout.". I get placed in the non-existent master branch and I need to manually checkout the main branch in order to access the files in the repository.
Upon inspection of the HEAD on the remote (in the Gitea repository folder on the server, via SSH), I see that the HEAD is set wrongly. It is ref: refs/heads/master, but it should be ref: refs/heads/main. Manually editing this solves the issue for this repository.
Note that this is not the case in the template repository, only in the one instanced from this template.
Seems to be related to #7601. While that is indeed fixed when creating a new repository from scratch, the problem seems to persist with repositories from templates.
The text was updated successfully, but these errors were encountered:
I am running Gitea using Docker, using the (slightly modified) docker-compose.yaml.
[x]
):Description
I created a template repository whose default branch is named "main" instead of "master". When I create a new repository from this template, ticking "Git Content (Default Branch)", the HEAD is set incorrectly on the server:
When cloning, I get the notice "warning: remote HEAD refers to nonexistent ref, unable to checkout.". I get placed in the non-existent master branch and I need to manually checkout the
main
branch in order to access the files in the repository.Upon inspection of the HEAD on the remote (in the Gitea repository folder on the server, via SSH), I see that the HEAD is set wrongly. It is
ref: refs/heads/master
, but it should beref: refs/heads/main
. Manually editing this solves the issue for this repository.Note that this is not the case in the template repository, only in the one instanced from this template.
I reproduced the issue in https://gitea.com/kb173/main-bug, which is instanced from the template https://gitea.com/kb173/template-default-main. As you can see, the web-UI correctly shows "main" as the only branch, but when cloning, the aforementioned warning occurs.
Seems to be related to #7601. While that is indeed fixed when creating a new repository from scratch, the problem seems to persist with repositories from templates.
The text was updated successfully, but these errors were encountered: