Skip to content

Instantly share code, notes, and snippets.

@mnemnion
Last active September 8, 2020 17:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnemnion/fd4d387436703de4ddc2379b008532cf to your computer and use it in GitHub Desktop.
Save mnemnion/fd4d387436703de4ddc2379b008532cf to your computer and use it in GitHub Desktop.
change git trunk-branch name from master to trunk
git checkout master
git branch -m master trunk
git fetch
git branch --unset-upstream
git branch -u origin/trunk
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/trunk
# Configure git to use trunk as default branch for new repositories
# requires git >= 2.28
git config --global init.defaultBranch trunk
git checkout master
git branch -m master trunk
git push -u origin trunk

Why would you do this

Don't actually care why you might.

I did it because it's a better name.

Fossil uses trunk and I'd use fossil if I could get away with it.

Are you sure it isn't because of

There is a difference between motive and opportunity.

These scripts are just means. Do what thou wilt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment