]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(git-current-branch): List local branches for `HEAD` master
authorOleg Broytman <phd@phdru.name>
Sat, 18 Jan 2025 11:05:26 +0000 (14:05 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 18 Jan 2025 11:05:26 +0000 (14:05 +0300)
List local branches from which `HEAD` is reachable.

git-current-branch

index 19cedf4ff1c35f09a290c464dbb237cce4443a45..d485deaf083f477fc46f8599874ad8f41e2654b4 100755 (executable)
@@ -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