Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lucaslarson/git-default-branch

🌳  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.
https://github.com/lucaslarson/git-default-branch

git-addons git-branches git-default-branch git-main-branch git-plugin hacktoberfest oh-my-zsh-plugin ohmyzsh-plugin posix-compatible posix-compliance posix-compliant zsh-plugin zsh-plugins

Last synced: 6 days ago
JSON representation

🌳  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.

Awesome Lists containing this project

README

        

git default-branch
------------------

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

https://github.com/LucasLarson/git-default-branch/actions?query=workflow:Super-Linter[image:https://github.com/LucasLarson/git-default-branch/workflows/Super-Linter/badge.svg[GitHub
Super-Linter,title="GitHub Super-Linter status"]]
https://github.com/LucasLarson/git-default-branch/blob/main/license.adoc[image:https://img.shields.io/badge/license-AGPL_3+-blue[AGPL,title="GNU
Affero General Public License v3.0 or later"]]

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.