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
Hello,
there is this visual bug on Gitea that does not happen when I do a similar process on GitHub/Gitlab.
In short, Gitea will remember the default branch name that was selected during repo creation after any branch is pushed instead of promoting the newly pushed branch to default.
On try.gitea.io I have created a new repository which contains some fork of mine from my self-hosted gitea.
By default Gitea will suggest me, the user, to use main as my default branch name. As a "clueless" user, I accept and proceed with the creation of the repo.
Now I have an empty repo on try.gitea.io. The default welcome page will tell me what to do next to push my already existing code to the remote.
git remote add origin https://try.gitea.io/diamante/zonetool.git
git push -u origin main
However, because in my scenario I am insisting on not using main I push a different branch to remote.
Here I push a branch called develop. This causes the following to happen:
Gitea is now convinced that I have pushed a new feature to a non-default branch and is proposing me to create a pull request. If I click that button it will lead me to:
Desired behaviour/Bug fix:
Because this does not happen on other platforms like GitHub or so I think, like, I do this often and nothing of this sort ever happens to me, I'd like the same behaviour to happen on gitea as well. As in the first branch to be ever pushed is promoted to default and overrides user/default preference in repo "branches" settings.
I tested this three other times on both try.gitea.io and my self-hosted instance and it does not always happen somehow?! This leaves me very perplexed as now I have no idea how to repro with 100% accuracy. It appears Gitea already has code to automatically promote to the default branch whatever gets pushed for the first time but does not always do it.
So the problem is that the first pushed branch should be the default branch no matter what it has been set.
But sometimes, the default branch won't be changed.
Maybe there's some problems of sync DB and git files, as the default branch you see in settings page is saved in DB.
Description
Hello,
there is this visual bug on Gitea that does not happen when I do a similar process on GitHub/Gitlab.
In short, Gitea will remember the default branch name that was selected during repo creation after any branch is pushed instead of promoting the newly pushed branch to
default
.On try.gitea.io I have created a new repository which contains some fork of mine from my self-hosted gitea.
By default Gitea will suggest me, the user, to use
main
as my default branch name. As a "clueless" user, I accept and proceed with the creation of the repo.Now I have an empty repo on try.gitea.io. The default welcome page will tell me what to do next to push my already existing code to the remote.
However, because in my scenario I am insisting on not using
main
I push a different branch to remote.Here I push a branch called
develop
. This causes the following to happen:Gitea is now convinced that I have pushed a new feature to a non-default branch and is proposing me to create a pull request. If I click that button it will lead me to:
https://try.gitea.io/diamante/zonetool/compare/main...develop
The page is 404 because the main branch never existed because I never pushed it
To fix my mistake I have to go to https://try.gitea.io/diamante/zonetool/settings/branches and edit the default branch name to suit my needs.
Desired behaviour/Bug fix:
Because this does not happen on other platforms like GitHub or so I think, like, I do this often and nothing of this sort ever happens to me, I'd like the same behaviour to happen on gitea as well. As in the first branch to be ever pushed is promoted to default and overrides user/default preference in repo "branches" settings.
cheers.
Gitea Version
1.23.0+dev-180-ge865de1e9d
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
https://try.gitea.io
Operating System
https://try.gitea.io
How are you running Gitea?
https://try.gitea.io
Database
None
The text was updated successfully, but these errors were encountered: