From: Oleg Broytman Date: Sat, 18 Jan 2025 11:05:26 +0000 (+0300) Subject: Feat(git-current-branch): List local branches for `HEAD` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=210a9cb6184c644d06be9aa8925d4a13e0c0403b;p=git-scripts.git Feat(git-current-branch): List local branches for `HEAD` List local branches from which `HEAD` is reachable. --- diff --git a/git-current-branch b/git-current-branch index 19cedf4..d485dea 100755 --- a/git-current-branch +++ b/git-current-branch @@ -4,6 +4,7 @@ git branch --show-current git describe --all +git for-each-ref --contains=HEAD --format="%(refname)" refs/heads/ git name-rev --name-only HEAD git rev-parse --abbrev-ref HEAD