Skip to content

Instantly share code, notes, and snippets.

@saemu
Last active February 18, 2022 06:55
Show Gist options
  • Save saemu/23cc70b512e6afc097500293e9f02c51 to your computer and use it in GitHub Desktop.
Save saemu/23cc70b512e6afc097500293e9f02c51 to your computer and use it in GitHub Desktop.
Git Settings
#!/bin/bash
curl -q https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
curl -q https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
cat << EOF >> ~/.bashrc
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
if [ -f ~/.git-prompt.sh ]; then
. ~/.git-prompt.sh
fi
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWCOLORHINTS=true
export PS1='[\u@\h \W\$(declare -F __git_ps1 &>/dev/null && __git_ps1 " (%s)")]\$ '
EOF
#!/bin/bash
git config --global alias.mylog "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
git config --global core.excludesfile ~/.gitignore
git config --global pull.rebase true
git config --global status.submodulesummary true
git config --global fetch.recursesubmodules true
git config --global fetch.prune true
git config --global tag.sort version:refname
git config --global color.status auto
git config --global color.branch auto
git config --global color.ui auto
git config --global diff.wserrorhighlight all
git config --global color.diff.whitespace "blue reverse"
git config --global rerere.enabled true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment