Skip to content

Instantly share code, notes, and snippets.

@ChrisBuchholz
Created June 29, 2015 09:49
Show Gist options
  • Save ChrisBuchholz/b42050ddb6dba35680f7 to your computer and use it in GitHub Desktop.
Save ChrisBuchholz/b42050ddb6dba35680f7 to your computer and use it in GitHub Desktop.
[alias]
s = status
c = commit -m
a = add
aa= !git add -u && git add . && git status
# add changes to the prior commit and keep original commit message
# similar to squashing two commits, but quicker
ca = commit --amend -C HEAD
cob = checkout -b
up = !git fetch origin && git rebase origin/master
# clean up history by squashing commits
ir = !git rebase -i origin/master
# merge into master, run all tests and push upstream
done = !git fetch && git rebase origin/master && git checkout master && git merge @{-1} && rake && git push
# remove remote branch references that no longer exist, cleanup unnecessary
# git files, remove untracked files from the working tree and clear out your stash
cleanup = !git remote prune origin && git gc && git clean -dfx && git stash clear
# who has contributed to the project ?
who = shortlog -n -s --no-merges
# remove the local and remote references when you delete feature branches
rmb = !sh -c 'git branch -D $1 && git push origin :$1' -
# pull changes from origin master on all submodules
subpull = !git submodule foreach git pull origin master
# pretty logging
plog = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment