Rename Gitea default branch: Difference between revisions
(Created page with "=On your own computer= ==Clone the repository== $ git clone <repo> $ cd <repo> ==Rename the default branch== $ git branch -m master main $ git status Returns: On b...") |
(No difference)
|
Latest revision as of 13:28, 8 April 2022
On your own computer
Clone the repository
$ git clone <repo> $ cd <repo>
Rename the default branch
$ git branch -m master main
$ git status
Returns:
On branch main Your branch is up to date with 'origin/master'. nothing to commit, working tree clean
Push the change
$ git push -u origin main
In Gitea
- Go to the repository
- Click "settings"
- Go to "Branches"
- Select the renamed branch as the default
- Click "Update Settings"
On your own computer
Delete the old branch
$ git push origin --delete master