Skip to content

Instantly share code, notes, and snippets.

@rummanwaqar
Last active August 29, 2015 14:15
Show Gist options
  • Save rummanwaqar/6d9ab123e3db214c8b3d to your computer and use it in GitHub Desktop.
Save rummanwaqar/6d9ab123e3db214c8b3d to your computer and use it in GitHub Desktop.
cd ~
echo "#Git completion setup" >> .bash_profile
# Enable tab completion
curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
echo "source ~/git-completion.bash" >> .bash_profile
# prompt setup
curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
echo "#Prompt setup" >> .bash_profile
# colors!
echo 'green="\[\033[0;32m\]"' >> .bash_profile
echo 'blue="\[\033[0;34m\]"' >> .bash_profile
echo 'purple="\[\033[0;35m\]"' >> .bash_profile
echo 'reset="\[\033[0m\]"' >> .bash_profile
# Change command prompt
echo "source ~/git-prompt.sh" >> .bash_profile
echo "export GIT_PS1_SHOWDIRTYSTATE=1" >> .bash_profile
# '\u' adds the name of the current user to the prompt
# '\$(__git_ps1)' adds git-related stuff
# '\W' adds the name of the current directory
echo 'export PS1="$purple\u$green\$(__git_ps1)$blue \W $ $reset"' >> .bash_profile
source .bash_profile
# github commands
git config --global core.editor "sub -n -w"
git config --global push.default upstream
git config --global merge.conflictstyle diff3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment