https://github.com/ltla/main2master
Convert your main branch back to its rightful name.
https://github.com/ltla/main2master
Last synced: about 1 year ago
JSON representation
Convert your main branch back to its rightful name.
- Host: GitHub
- URL: https://github.com/ltla/main2master
- Owner: LTLA
- License: gpl-3.0
- Created: 2020-12-26T07:16:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-26T07:34:04.000Z (over 5 years ago)
- Last Synced: 2025-02-10T12:29:33.890Z (over 1 year ago)
- Language: Shell
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rename your `main` branch to `master`
Recently, GitHub decided to name the default branch upon new repository creation to `main`, in response to... diversity or social justice or blah blah blah.
I won't go over why I think this is a stupid idea - that has been covered exhaustively in a million threads on Twitter, Reddit, GitHub itself, etc. - but suffice to say, I don't like it.
So I wrote this little script to convert everything back to the way it should be:
```sh
./main2master user/repo PAT
```
This will make a `master` branch from your existing `main`, push the former up, and delete the latter.
An easy way to restore sanity if your overly woke colleagues or collaborators got a little bit too excited about the power of version control to... end racism.. or something.
**To do:**
- Replicate branch protection in the new `master`.
- Figure out how to do the deletion without a PAT.