Skip to content

Instantly share code, notes, and snippets.

@bootcoder
Created October 18, 2016 22:20
Show Gist options
  • Save bootcoder/e24dd8009f38fdfa75e68bf1716dfe07 to your computer and use it in GitHub Desktop.
Save bootcoder/e24dd8009f38fdfa75e68bf1716dfe07 to your computer and use it in GitHub Desktop.
Git Config file from my master Mac
[core]
# Excludesfiles allows us to set a global list of things to ignore
excludesfile = ~/.gitignore_global
# These are custom color options for the console
[color]
status = auto
diff = auto
[color "status"]
untracked = cyan
changed = green
added = yellow
# Aliases are command shortcuts
[alias]
# lg is now a shortcut for a pretty log with short commit messages
# See the log manpage: https://www.kernel.org/pub/software/scm/git/docs/git-log.html
# for explanations of what these options do
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Shorthand for a less noisy status
s = commit --dry-run --short
# More sensible names for adding and removing files from the readme
stage = add
unstage = reset HEAD
# Edit the last commit
amend= commit --verbose --amend
# one-line log
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
a = add
ap = add -p
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
m = commit --amend --verbose
d = diff
ds = diff --stat
dc = diff --cached
co = checkout
cob = checkout -b
# list branches sorted by last modified
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
# list aliases
la = "!git config -l | grep alias"
[credential]
helper = cache --timeout=14400
[user]
email = [email protected]
name = BootCoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment