Skip to content

Instantly share code, notes, and snippets.

@twitchel
Last active July 8, 2018 22:51
Show Gist options
  • Save twitchel/77115846eba7da32b7663f73b33ecd35 to your computer and use it in GitHub Desktop.
Save twitchel/77115846eba7da32b7663f73b33ecd35 to your computer and use it in GitHub Desktop.
[user]
name = {user.fullname}
email = {user.email}
[core]
editor = nano
[commit]
template = /Users/{user.login}/.stCommitMsg
[alias]
ls = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
filelog = log -u
fl = log -u
a = add
ap = add -p
cm = commit -m
d = diff
ds = diff --stat
dc = diff --cached
s = status -s
co = checkout
cob = checkout -b
cop = checkout -p
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
#parent = "!git show-branch -a | grep '\*' | grep -v `git rev-parse --abbrev-ref HEAD` | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'"
track = "![[ $(git config branch.$(git symbolic-ref --short HEAD).merge) = '' ]] && git push -u origin $(git symbolic-ref --short HEAD) || git push"
undo-commit = reset --soft HEAD~1
# show aliases
la = "!git config -l | grep alias | cut -c 7-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment