Project init instructions do not take the default branch into account when the project has been set up using a template #452

Open
opened 1 month ago by ncc1988 · 5 comments
ncc1988 commented 1 month ago

I have set up a project using a template that sets the default branch to master instead of main. When I open the project page, the instructions to setup the repository suggest doing a git push -u origin main instead of a git push -u origin master, which would be correct for that repository.

The instructions are correct for new projects that aren't created from a template and where the default branch is set via the input field in the form to create a new project.

I have set up a project using a template that sets the default branch to master instead of main. When I open the project page, the instructions to setup the repository suggest doing a git push -u origin main instead of a git push -u origin master, which would be correct for that repository. The instructions are correct for new projects that aren't created from a template and where the default branch is set via the input field in the form to create a new project.
Poster
This is the template: https://codeberg.org/ncc1988/template-gpl3-or-later-and-master-branch And this is the project created from it: https://codeberg.org/ncc1988/yauclib
Collaborator

So the point is that you can change the default branch in an empty template repo where you didn't push any content, and you expected this to be applied to the repo created out of this, but it wasn't?

Bug / Feature request: Respect default branch setting from (empty?) templates when creating repo?

So the point is that you can change the default branch in an empty template repo where you didn't push any content, and you expected this to be applied to the repo created out of this, but it wasn't? Bug / Feature request: Respect default branch setting from (empty?) templates when creating repo?
6543 added the
gitea-related
label 1 month ago
Collaborator

this is definetly an enhancement of the template function, it will take the default branch when the template repo is not empty ... but for empty ones it has to be implemented, ...

you also only can set default branch on repo creation and not afterwards on an empty one ...

this is definetly an enhancement of the template function, it will take the default branch when the template repo is **not** empty ... but for empty ones it has to be implemented, ... you also only can set default branch on repo creation and not afterwards on an empty one ...
6543 added the
enhancement
label 1 month ago
Poster

So the point is that you can change the default branch in an empty template repo where you didn't push any content, and you expected this to be applied to the repo created out of this, but it wasn't?

Exactly. At least the instructions on the empty repo created out of the empty template repo did not take into account the changed default branch name. When I pushed to the master branch, everything seemed ok though.

> So the point is that you can change the default branch in an empty template repo where you didn't push any content, and you expected this to be applied to the repo created out of this, but it wasn't? Exactly. At least the instructions on the empty repo created out of the empty template repo did not take into account the changed default branch name. When I pushed to the master branch, everything seemed ok though.
Collaborator

Yes sine a push to an empty repo update the dedaulr branch, independent from current defaultbranch set in db.

The default branch on empty repos is only used in the push instructions ...

Yes sine a push to an empty repo update the dedaulr branch, independent from current defaultbranch set in db. The default branch on empty repos is only used in the push instructions ...
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.