Skip to content

Instantly share code, notes, and snippets.

@psynaptic
Created December 2, 2014 14:55
Show Gist options
  • Save psynaptic/6e66cfcbba7f3200ca25 to your computer and use it in GitHub Desktop.
Save psynaptic/6e66cfcbba7f3200ca25 to your computer and use it in GitHub Desktop.
[alias]
e = config --global --edit
s = status -s
st = status
ci = commit -m
cl = clone
br = branch
co = checkout
praise = blame
wtf = blame
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
branch-name = !git for-each-ref --format='%(refname:short)' "$(git symbolic-ref HEAD)"
bn = "!bash -c 'branch=$(git branch-name); echo -n $branch | pbcopy'"
fp = !git format-patch --stdout "$1"..$(git branch-name) > "~/patches/$(git branch-name).patch"
rn = !git log --pretty=format:\"* %s\"
ignored = ls-files -o -i --exclude-standard
unstage = reset HEAD
alias = config --get-regexp alias
root = !pwd
ad = !git add . && git diff --cached
df = diff
dw = diff --word-diff
ds = diff --stat
dw = diff --color-words
dc = diff --cached
dcs = diff --cached --stat
lp = log -p
lo = log --graph --decorate --pretty=oneline --abbrev-commit
lg = log --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %C(green)(%an %cr)%Creset'
ls = ls-files
f = fetch origin
r = !git fetch origin $(git branch-name) && git rebase
set-upstream = !git branch --set-upstream-to=origin/$(git branch-name) $(git branch-name)
i = rebase -i
ba = branch -a
rv = remote -v
publish = !git push -u origin "$(git branch-name)"
cp = cherry-pick
save = stash save
stashed = stash list
unstash = stash apply
drop = "!sh -c 'git stash drop stash@{$1}' -"
pop = "!sh -c 'git stash apply stash@{$1}' -"
undo = reset --hard
uncommit = !git reset --soft HEAD^ && git reset
rollback = reset --soft
amend = commit --amend
fixup = rebase --interactive "HEAD~2"
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep '^h'"
lasttag = describe --tags --abbrev=0
ours = "!_() { git co --ours $@ && git add $@; }; _"
theirs = "!_() { git co --theirs $@ && git add $@; }; _"
show-merge = diff HEAD^ HEAD^2
prefix = !echo $GIT_PREFIX
conflicts = !git diff --name-only --diff-filter=U | sed \"s@^$GIT_PREFIX@@\"
integrate = "!sh -c 'branch=$(git branch-name); echo Integrating $branch; git fetch origin integration && git branch -D integration && git checkout -b integration origin/integration && git merge --no-ff --no-edit $branch && git push origin integration && git checkout $branch'"
tags-by-date = !git for-each-ref --format='%(refname:short) %(*authordate:local)' \"refs/tags/${1}*\"
phpcs = !phpcs --standard=/Users/psynaptic/src/drupal/coder/coder_sniffer/Drupal --extensions=php,inc,test,engine,install,module,profile,theme -- $(git diff --name-only)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment