Skip to content

Instantly share code, notes, and snippets.

@toan267
Forked from clupasq/awesome-git-setup.sh
Created September 15, 2017 09:07
Show Gist options
  • Save toan267/31bc82b40ef3126e5657fe9a491ed9b5 to your computer and use it in GitHub Desktop.
Save toan267/31bc82b40ef3126e5657fe9a491ed9b5 to your computer and use it in GitHub Desktop.
Awesome git prompt for Linux
# 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