Hey everyone,
We're in the process of switching to using `main` as the default branch in our repositories. I've created a ticket to document and manage this switch:
https://gitlab.torproject.org/tpo/anti-censorship/team/-/issues/6
The impact to contributors will be small. Those who have already cloned the repository just need to remember to develop new patches off of the `main` branch. Merge requests in Gitlab will automatically open against the default branch, so if your MR has more commits than you expect you'll just need to rebase it onto the main branch.
The hardest part is on the maintainer side since we manage so many repositories. I've tried to document all the repositories in the ticket above, but left out some very old unmaintained repos (such as pyptlib) that I don't have permission to maintain. If in the unlikely event these projects are brought back to life we can deal with a branch change then.
If you think anything on or off this list is a mistake, feel free to comment on the ticket!
For the procedure, I'll be running this script written by anarcat (our sysadmin): https://gitlab.com/anarcat/scripts/-/blob/main/git-branch-rename-remote
The script will generally: - run `git branch --move master main`
- change symbolic refs for remote: `git symbolic-ref refs/remotes/remote/HEAD \ refs/remotes/remote/main`
- set local branch to track new upstream `git branch -u remote/main`
- push new main branch to remote `git push -u remote main`
- remove old master branch from remote: `git push -d remote master`
- For GitLab, update the default branch to main
My plan will be to make this change on Friday unless we realize there is more prerequisite work to do. Let me know if you have questions.
Cecylia
On 2021-05-05 10:07 a.m., Cecylia Bocovich wrote:
Hey everyone,
We're in the process of switching to using `main` as the default branch in our repositories. I've created a ticket to document and manage this switch:
https://gitlab.torproject.org/tpo/anti-censorship/team/-/issues/6
Hi,
This migration from `master` to `main` is done for the anti-censorship team repositories that we maintain. You can see a full list in the ticket above. When you clone one of the anti-censorship team repositories from GitLab or git@git-rw.torproject.org, the main branch should be checked out by default. For any contributors who have checked out one of these repositories, you'll need to run the following commands to update your local copy:
``` $ git checkout master $ git branch -m master main $ git fetch [remote] $ git branch -u origin/main main $ git remote set-head [remote] -a ```
If you've checked your code out using HTTPS from https://git.torproject.org, the changes are slow in taking affect so the last `remote set-head` step might not be updated yet.
If you had open merge requests these have been updated to target the main branch.
Please let us know if you have any difficulty with the switch!
Cecylia
anti-censorship-team@lists.torproject.org