... | ... | @@ -476,9 +476,10 @@ GitLab remotes, where it "un-protects" and "re-protects" the branch. |
|
|
You should run the script with an account that has "Maintainer" or
|
|
|
"Owner" access to GitLab, so that it can do the above GitLab API
|
|
|
changes. You will then need to provide an [access token](https://gitlab.torproject.org/-/profile/personal_access_tokens) through
|
|
|
the `GITLAB_PRIVATE_TOKEN` environment variable. So, for example, this
|
|
|
will rename the `master` branch to `main` on the local and remote
|
|
|
repos:
|
|
|
the `GITLAB_PRIVATE_TOKEN` environment variable.
|
|
|
|
|
|
So, for example, this will rename the `master` branch to `main` on the
|
|
|
local and remote repos:
|
|
|
|
|
|
GITLAB_PRIVATE_TOKEN=REDACTED git-branch-rename-remote
|
|
|
|
... | ... | @@ -491,13 +492,15 @@ on the commandline as well. For example, this will rename the |
|
|
The command can also be used to fix *other* repositories so that they
|
|
|
correctly rename their local branch too. In that case, the GitLab
|
|
|
repository is already up to date, so there is no need for an access
|
|
|
token, and just running this command will rename `master` to `main` on
|
|
|
the local repo, including remote tracking branches:
|
|
|
token.
|
|
|
|
|
|
Other users, then can just run this command will rename `master` to
|
|
|
`main` on the local repo, including remote tracking branches:
|
|
|
|
|
|
git-branch-rename-remote
|
|
|
|
|
|
However, there are a few extra steps and considerations to make when
|
|
|
changing the name of a heavily used branch.
|
|
|
Keep in mind that there may be a few extra steps and considerations to
|
|
|
make when changing the name of a heavily used branch, detailed below.
|
|
|
|
|
|
### Modifying open Merge Requests
|
|
|
|
... | ... | |