unixorn/git-extra-commands

View on GitHub
bin/git-upstream-name

Summary

Maintainability
Test Coverage
#!/usr/bin/env bash
#
# Print the upstream of the current branch
#
# Copyright 2022, Joe Block <jpb@unixorn.net>

exec git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"