-
-
Save toan267/31bc82b40ef3126e5657fe9a491ed9b5 to your computer and use it in GitHub Desktop.
Awesome git prompt for Linux
This file contains 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
# Creates a script that will: | |
# - customize the prompt to use posh-git-sh | |
# - add git-completion | |
DIRECTORY=~/.awesome-git-prompt | |
SCRIPT=~/git-prompt.sh | |
if [ ! -d "$DIRECTORY" ]; then | |
mkdir "$DIRECTORY" | |
git clone https://github.com/lyze/posh-git-sh.git "$DIRECTORY/posh-git-sh" | |
wget -P "$DIRECTORY" https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash | |
echo " | |
source $DIRECTORY/posh-git-sh/git-prompt.sh | |
source $DIRECTORY/git-completion.bash | |
export PROMPT_COMMAND='__posh_git_ps1 \"\\\\[\\[\\e[0;32m\\]\\u@\\h \\[\\e[0;33m\\]\\w\" \" \\[\\e[1;34m\\]\\n\\$\\[\\e[0m\\] \";'$PROMPT_COMMAND | |
" > "$SCRIPT" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment