Last active
October 6, 2024 13:44
-
-
Save ejmr/a927d32e25488a282bd3 to your computer and use it in GitHub Desktop.
Show the Description for the Current Branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# You can use `git branch --edit-description` to write a description | |
# for a branch, but Git provides no simple command to display that | |
# description. The "easiest" way to see it is via `git config --get | |
# branch.BRANCH_NAME.description`. | |
# | |
# This script automates that process and is meant to be used as | |
# a Git alias to provide a shorter command for showing the | |
# description of the current branch. | |
# | |
####################################################################### | |
BRANCH="$(git symbolic-ref --short HEAD)" | |
DESCRIPTION_PROPERTY="branch.${BRANCH}.description" | |
git config --get "$DESCRIPTION_PROPERTY" |
Its helpful~π
Thanks, I needed this. π
It's absolutely bewildering that git branch list
doesn't have a --descriptions
Thanks! As simple as that!
Gracias ππ½
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the this. Really helpful. Minor typo: the beginning of Line 16 should be 'git', not 'get'