diff options
author | CoprDistGit <infra@openeuler.org> | 2024-10-30 14:37:15 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-10-30 14:37:15 +0000 |
commit | f63bda2c1241858de214ca3ec1810c8672c775fd (patch) | |
tree | 67bdd88b6a37f1fdc46c37c1f0a28bad5d1dc380 /git-prompt.sh | |
parent | 850e41cbd0c9a287ae4fe92233c508dcd620f4e6 (diff) |
automatic import of gitopeneuler24.03_LTS
Diffstat (limited to 'git-prompt.sh')
-rw-r--r-- | git-prompt.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/git-prompt.sh b/git-prompt.sh new file mode 100644 index 0000000..c3741b1 --- /dev/null +++ b/git-prompt.sh @@ -0,0 +1,6 @@ +# Include the current git branch in the prompt + +if [ -f /usr/share/bash-completion/completions/git-prompt.sh ]; then + . /usr/share/bash-completion/completions/git-prompt.sh + PS1="$(echo -n "$PS1" | sed "s|\\\W\]|\\\W\$(type __git_ps1 >/dev/null 2>\&1 \&\& __git_ps1 \" (%s)\")\]|")" +fi |