Skip to content

Instantly share code, notes, and snippets.

@davelyon
Last active December 11, 2015 05:29
Show Gist options
  • Save davelyon/4552794 to your computer and use it in GitHub Desktop.
Save davelyon/4552794 to your computer and use it in GitHub Desktop.
[alias]
st = status
ci = commit
co = checkout
cp = cherry-pick
put = push origin HEAD
fixup = !sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -
squash = !sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -
ri = rebase --interactive
br = branch
pruneremote = remote prune origin
tree = log --graph --oneline --decorate --color --all
tr = log --graph --oneline --decorate --color
unpushed = !"PROJ_BRANCH=$(git symbolic-ref HEAD | sed 's|refs/heads/||') && git log origin/$PROJ_BRANCH..HEAD"
unpulled = !"PROJ_BRANCH=$(git symbolic-ref HEAD | sed 's|refs/heads/||') && git fetch && git log HEAD..origin/$PROJ_BRANCH"
add-untracked = !"git status --porcelain | awk '/\\?\\?/{ print $2 }' | xargs git add"
ln = log --pretty=format:'%Cblue%h %Cred* %C(yellow)%s'
reset-authors = commit --amend --reset-author -CHEAD
recommit = commit --amend -CHEAD
[branch]
autosetuprebase = always
[color]
ui = auto
[core]
excludesfile = ~/.cvsignore
whitespace = warn
[help]
autocorrect = 10
[include]
path = ~/.gitconfig.local
[merge]
summary = true
[merge "bundlelock"]
name = lock Gemfile
driver = bundle install
[merge "bundle"]
name = bundle
driver = bundle
[merge "railsschema"]
name = newer Rails schema version
driver = "ruby -e '\n\
system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)\n\
b = File.read(%(%A))\n\
b.sub!(/^<+ .*\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n=+\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n>+ .*/) do\n\
%(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)\n\
end\n\
File.open(%(%A), %(w)) {|f| f.write(b)}\n\
exit 1 if b.include?(%(<)*%L)'"
[push]
default = tracking
[rebase]
autosquash = true
stat = true
[user]
email = [email protected]
name = "Dave Lyon"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment