Skip to content

Instantly share code, notes, and snippets.

@BernardoSilva
Last active May 2, 2020 18:34
Show Gist options
  • Save BernardoSilva/0793d9a7f90caa3c3ad8 to your computer and use it in GitHub Desktop.
Save BernardoSilva/0793d9a7f90caa3c3ad8 to your computer and use it in GitHub Desktop.
Optimize your git performance on MAC OS X tips
# Highlight hash commit.
git config --global color.ui true
# Set opendiff as predefined tool to open while merging.
git config --global merge.tool opendiff
# Set alias for `git status` to `git st`.
git config --global alias.st status
# Shorter git status messages.
git config --global alias.s "status -s"
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
# Add alias for new console log output.
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"
git config --global alias.lg "log --oneline --graph --decorate --all --pretty=oneline --abbrev-commit --graph"
# When working with submodules, this will check if any submodule has changes and push them as well.
# This covers the problem that you have to push submodules before the main project.
git config --global alias.pushall "push --recurse-submodules=on-demand"
# Add an alias to pull all submodules
# git submodule foreach git pull origin development
# When you do git pull it will do a fetch and a rebase instead of a fetch and merge. (avoid extra commits)
git config --global pull.rebase true
# Alias for lazy people =D
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gs="git status"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment