We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b032b41 commit c79e5b3Copy full SHA for c79e5b3
prompt.sh
@@ -2,8 +2,13 @@ find_git_branch() {
2
# Based on: http://stackoverflow.com/a/13003854/170413
3
local branch
4
if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then
5
+ # check to see if on a tag
6
if [[ "$branch" == "HEAD" ]]; then
- branch='detached*'
7
+ if tag=$(git describe --exact-match >&1 2> /dev/null); then
8
+ branch="tags/$tag"
9
+ else
10
+ branch='detached*'
11
+ fi
12
fi
13
git_branch="($branch)"
14
else
0 commit comments