Closed
Description
Description
If you create a template with a different default branch (e.g. not 'main') and create another repository from that template, it sets the default branch to an empty reference to 'main' causing this error when cloning it warning: remote HEAD refers to nonexistent ref, unable to checkout.
. This can be resolved by changing the default branch to the one from the template but that should be the default behavior or at least it should provide an option to specify the name of the branch.
To reproduce:
- Create a template repository with the default branch as anything but 'main'.
- Create a repository from that template including the git content of the template.
- Check to see if the default branch points to an invalid ref.
Gitea Version
1.18.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Problem exists on both https://try.gitea.io/ and docker.
Database
No response