Skip to content

Instantly share code, notes, and snippets.

View taiki-e's full-sized avatar
💭
I may be slow to respond.

Taiki Endo taiki-e

💭
I may be slow to respond.
View GitHub Profile
@taiki-e
taiki-e / maintenance-status-badges.md
Last active February 12, 2024 22:37
Markdown Maintenance status badges
@taiki-e
taiki-e / get_default_branch.sh
Last active November 8, 2020 20:40
Getting the default branch of a remote repository
# Gets the default branch of a remote repository.
#
# Example: git fetch --prune upstream && && git merge "upstream/$(default_branch upstream)"
function default_branch() {
git remote show "${1:-origin}" | grep 'HEAD branch' | sed 's/ *HEAD branch: //'
}