This tool lets you rename your GitHub default branches to whatever you want.
Create a GitHub personal access token with the repo scope, fill out the fields, but don't check the box unless you know those branches are safe to delete!
What's a default branch?
It's the base branch in a GitHub repository, which by default is
Why should I use this tool?
Freedom of speech! Defy conventions! Express yourself in one word!
Who, other than suspicious testimonials, would trust this site?
Nobody. So you should really read the source code and run it yourself.
Will I encounter issues if branches with the same name already exist, or if there are many external hyperlinks to the
master branch, or if many people use my repo as a submodule, or if I have many forks I don't want to touch, or if I have over 1239 repositories, or if I'm using multiple remotes, or if I'm using Netscape Navigator 3.02?
Yes, yes, yes, yes, yes, yes, and yes. In any case, don't use this tool. Nevertheless, feel free to modify it to suit your needs!
Would any changes be irreversible?
Not unless you check the box to delete your old default branches. Usually, you can just run the script again in reverse to undo your changes. Otherwise, if you're not a casual user (see above), this tool isn't for you.
Whose repositories does this affect?
This script only affects repos under your username, unfortunately including all forks. It does not affect any repos owned by organizations, even if you are an owner of such a repo, because presumably you should probably consult your collaborators first before breaking everything.
Which scopes should I select when creating my token?
You should select repo if you want to change both public and private repos, or just public_repo if you don't trust that I wouldn't "accidentally" delete all your private repos. Remember to revoke your token afterwards!
Where's the progress indicator?
Whatever shall I do, in order to switch to my new branch on my local repositories after running this script?
If you're scared of Git, you can do the usual: delete and clone again.
If your local branch is behind or even with your remote branch, try:
git pull git checkout <new_branch> git branch -d <old_branch> git remote update -p
If your local branch is ahead of your remote branch, try:
git checkout -b <new_branch> git branch -d <old_branch> git push <remote> -u <new_branch> git remote update -p
Here's an example of the bash loop that I used:
for d in ./*/; do ( cd "$d" && git pull && git checkout salad && git branch -d master && git remote update -p ) done
Whom should I ask for help in configuring
git init to initialize new repositories with a different default branch?
See this StackOverflow answer by nicoo for details.
When will you write a script to rename GitLab default branches?
Tomorrow, if this gets over 10 upvotes on Hacker News or Reddit. Otherwise never, because nobody would ever use it, not even myself. [Update: I got four upvotes on both Hacker News and Reddit, so never. Reddit and the eight people who downvoted this must hate free speech!]
Was this script thoroughly checked for bugs?
No. I express no representation or warranties of any kind whatsoever, including without limitation the implied warranties of merchantability and fitness for a particular purpose, all of which I hereby disclaim to the fullest extent permitted by law.
Whoever could have "accidentally" deleted all of my repos?
It wasn't me! Again, please read the source code to double-check.
Were any of these "frequently" asked questions ever asked?
Amazing tool. If this didn't already exist, I would have written it myself!
i haven’t used it but i’m sure it probably works
I was paid $0.10 to give my 2 cents here. This script sucks!!!
Never used tool
this tool will definitely advance humanity 10/10
I can now sleep at night knowing racism has ended.
none of the people in the testimonials even used the tool...
The tool you wrote is very neat! I thought about making a tool that just does the "patch" part (changing the default branch) but in the end I opted to just change them all manually since it didn't take long. However, I'm sure your tool could be handy for others, especially if there are a lot of repos to go through.
this sounds like a lot of effort when I only have one repository
YOOOOooOOOOoOoOo i don't even have any repositories!!!!
what is this
This tool is useless
I don't remember how to git and I also got locked out of my account last year but if I could use it im sure this would be life changing
I used to spend a lot of my time trying to rename my github branches. Now, its done at the click of a button!
this cured my cancer
this is so much better than plain old
git branch -m master salad.
pretty sure this got one of my coworkers fired yesterday when all the links to
tree/master broke, nice job
So I can rename it to
master after GitHub takes this race play too far?
this is so important in 2020! We must work to completely abolish terms like
master from the tech world!
ah I see, doing away with the master slave terminology
I always felt like
master was a little bit too oppressive for me, now I feel much safer coding! 10/5 would recommend it to anyone!
The author has excellent taste in anime.
I am surprised this tool doesn’t need a credit card number and the three digits on the back to work, considering I discovered it on a kissanime ad banner
すごい！このツールは面白くて、かっこいいですよ！やれやれだぜ。Grabe talaga yung tool na ito. Napakagaling, di mo na kailangan magsulat ng git commands sa terminal. Astig!
this gave me cancer
I'd love to invest in your startup but I just don't see a clear monetization strategy.
Is this web scale? MongoDB is web scale. Can this use MongoDB?
scary. can this defeat science advising?
oh no, what if it steals my API keys
The source code ain't Rust, can't trust it. I hardly even trust my own code.
this tool will turn u into a 10x developer
This tool renamed my life. I am now X Æ A-12 Musk
So convenient and such a good idea! Thanks for building!
Eugene told me this tool is great and I think he's right
According to Eugene I can use this to make myself look cool. Thanks Eugene!!!
Writing testimonial because I just want to feel included.
i dont social distance much
LOOL sorey I missed it, I defijitely didnt know what was happening
seems cool, probably won’t use it. I like my repos the way they are. This is going to break my repos that have multiple remotes.
I was probably the only person who actually used it? Works as intended. I’m deleting the token just in case.
...and if you'd like to create/update/destroy your own testimonial, raise an issue!