scatterd-dotfiles/gitconfig
Dan Croak 49a4597dc4 Make it easy to checkout GitHub pull requests
This alias makes the following workflow possible:

Look at changes:

    git co-pr 123
    git diff origin/master

Bundle, validate tests are passing:

    bundle
    rake

Rebase interactively, squash, and potentially improve commit messages:

    git rebase -i master

Merge code into master:

    git checkout master
    git merge pr/123 --ff-only

Push:

    git push origin master

Clean up:

    git branch -D pr/123
2014-07-25 19:09:11 -07:00

28 lines
771 B
Text

[push]
default = current
[color]
ui = auto
[alias]
aa = add --all
ap = add --patch
ca = commit --amend
ci = commit -v
co = checkout
co-pr = !sh -c 'git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1' -
create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' -
delete-branch = !sh -c 'git push origin :refs/heads/$1 && git branch -D $1' -
merge-branch = !git checkout master && git merge @{-1}
pr = !hub pull-request
st = status
up = !git fetch origin && git rebase origin/master
[core]
excludesfile = ~/.gitignore
autocrlf = input
[merge]
ff = only
[include]
path = .gitconfig.local
[commit]
template = ~/.gitmessage
[fetch]
prune = true