Last active
August 30, 2022 01:45
-
-
Save mrevjd/b06436593bdf27606fc21507c2dc4853 to your computer and use it in GitHub Desktop.
Git Global Config
This file contains hidden or 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
| # GIT Defaults: | |
| git config --global user.name "Your Name" | |
| git config --global user.email "your@email.address" | |
| git config --global color.ui auto | |
| git config --global push.default simple | |
| git config --global alias.ci commit | |
| git config --global alias.stat status | |
| git config --global core.editor vim | |
| git config --global init.defaultBranch main | |
| # will always include tag metadata in push | |
| git config --global push.followTags true | |
| # use 4 spaces for tabs in diff (instead of 8) | |
| git config --global core.pager 'less -x4' | |
| # better log (git lg / git lg –p / git lg --stat) | |
| git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
| # as above, no merges | |
| git config --global alias.lgn "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --no-merges" | |
| # shortcut to branch -vv | |
| git config --global alias.bv "branch -vv" | |
| git config --global alias.p "pull -v" | |
| git config --global alias.f "fetch --all" | |
| # grep should read .gitignore and show colour | |
| git config --global alias.grep "grep --exclude-standard --color" | |
| # sync dev to my feature branch (run while in feature branch) | |
| git config --global alias.rbdev "pull --rebase origin develop" | |
| # show differences from last commit | |
| git config --global alias.sh "show --color --pretty=format:%b" | |
| # Auto setup reomte on push | |
| git config --global push.autoSetupRemote true | |
| # For use with GH Desktop and WSL | |
| # On Windows, using Git Bash for instance: | |
| # git config --global core.fileMode false | |
| # On WSL terminal: | |
| # git config --global core.fileMode true | |
| # Also, in case you didn't have this setting when cloning repositories on WSL, you need to disable explicitly it per repository: | |
| # git config --local --unset core.fileMode | |
| # This configuration will make pull commands rebase instead of merge | |
| # git config --global pull.rebase true | |
| # This configuration will automatically clean Git objects in your repository locally whenever you fetch changes from remote. | |
| git config --global fetch.prune true | |
| # This configuration adds extra colors when running git diff to show blocks of lines that remain unchanged but have moved in the file. | |
| git config --global diff.colorMoved zebra |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment