Skip to content

Commit

Permalink
git: Add config to set branch to main when initializing a repo
Browse files Browse the repository at this point in the history
* This is possible as of Git 2.28 without using templates by setting
  `init.defaultBranch`.
  • Loading branch information
sglavoie committed Jan 24, 2021
1 parent d8ae0dd commit 1f5ce18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .git-templates/HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref: refs/heads/main
3 changes: 3 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@
rebase = false
[credential]
helper = store
[init]
defaultBranch = main
templateDir = ~/.git-templates

0 comments on commit 1f5ce18

Please sign in to comment.