Skip to content

Instantly share code, notes, and snippets.

@emaxerrno
Forked from kneath/._what.md
Last active August 29, 2015 14:08
Show Gist options
  • Save emaxerrno/541902b54934395d3922 to your computer and use it in GitHub Desktop.
Save emaxerrno/541902b54934395d3922 to your computer and use it in GitHub Desktop.

Badass git pull alternative

Add this little snippet to your ~/.gitconfig and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Scott Chacon and Ryan Tomayko basically figured out how to do this and I am stealing all of the credit.

[alias]
up = !sh -c 'git pull --rebase --prune && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..'
main_site(mirroring) % git up
Updating 83856d9..3753172
Fast forward
app/controllers/repositories_controller.rb | 2 ++
app/views/repositories/new_mirror.html.erb | 2 +-
2 files changed, 3 insertions(+), 1 deletions(-)
[email protected] - Handle creating mirror when mirror repo form submitted (2 days ago)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment