Skip to content

🌳  What’s in a name? It doesn’t matter. Find the name of a Git repository’s default branch with a POSIX-compliant shell script.

License

Notifications You must be signed in to change notification settings

LucasLarson/git-default-branch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git default-branch

🌳 What’s in a name? It doesn’t matter.

GitHub Super-Linter AGPL

What

During the course of versioning software history, myriad names have been used as the default for the chief branch, including trunk, development, develop, dev, master, main, mainline, baseline, and sometimes even default.

Why

Finding Oh My Zsh’s heuristic insufficient (Oh My Zsh decides the default branch is named main if that branch exists, otherwise they assume it’s master), I created this script to more quickly and more accurately ascertain this information.