Skip to content

Instantly share code, notes, and snippets.

@QinMing
Last active April 8, 2022 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save QinMing/997a502af8856d31b61d51fc747c551a to your computer and use it in GitHub Desktop.
Save QinMing/997a502af8856d31b61d51fc747c551a to your computer and use it in GitHub Desktop.
My git configurations, mainly alias. Just need to run it once.
#!/bin/bash
git config --global user.name "Ming Qin"
git config --global user.email "$email_address"
git config --global push.default current
git config --global alias.l "log --stat --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(blue)(%an %ch)%Creset%n' --abbrev-commit"
git config --global alias.last "log -1 HEAD"
git config --global alias.a "add"
git config --global alias.b "branch -v --sort=committerdate"
git config --global alias.c "commit"
git config --global alias.cm "commit"
git config --global alias.wip "commit -am wip"
git config --global alias.amend "commit --amend -a --no-edit"
git config --global alias.ck "checkout"
git config --global alias.d "diff"
git config --global alias.f "fetch"
#git config --global alias.s "status -uno"
git config --global alias.s "status"
git config --global alias.p "pull"
git config --global alias.r "remote"
git config --global init.defaultBranch main
#by ggustafsson http://superuser.com/questions/366930/how-do-i-get-the-git-pager-to-clean-up-screen-output-after-exit
git config --global core.pager 'less -+$LESS -R'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment