Last active
April 21, 2025 22:03
-
-
Save expatjedi/0530d23a6769fecaaa11010c7c568fd5 to your computer and use it in GitHub Desktop.
Bash prompt for developers
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
function parse_git_dirty { | |
[[ $(git status --porcelain 2> /dev/null) ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ (\1$(parse_git_dirty))/" | |
} | |
PS1="\n\t \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " |
Comments are disabled for this gist.