Make main the default git branch
New Repository
Git will use a user-defined template when starting a new git repository, so configure that template to use "main" instead of the default.
git config --global init.templateDir '~/.git-template'
cp -r /usr/local/share/git-core/templates ~/.git-template
echo 'ref: refs/heads/main' > ~/.git-template/HEAD
From that point on git init will use the template with the HEAD pointing to main.
Existing Repository
- Read more about Make main the default git branch
- Log in to post comments
How to create and apply a patch with Git — ariejan de vroom
a blog by ariejan de vroom about software engineering and craftsmanship.
Setting Up a Mac Dev Machine From Zero to Hero With Dotfiles - Tuts+ Code
Tutorial
Setting up a new machine can often be an exciting prospect. However, as developers,
there are a lot of tools we need that don't come as standard. In this post, I'd like to go
through some of the techniques I use to help set up my machine quickly, efficiently and with
added super powers. | Difficulty: Beginner; Length: Short; Tags: Tools & Tips, Web
Development, Dotfiles, Git
skwp/dotfiles · GitHub
dotfiles - YADR - The best vim,git,zsh plugins and the cleanest vimrc you've ever seen