Skip to content

Instantly share code, notes, and snippets.

@richistron
Created September 9, 2014 13:35
Show Gist options
  • Save richistron/ea2ca375391b2497f842 to your computer and use it in GitHub Desktop.
Save richistron/ea2ca375391b2497f842 to your computer and use it in GitHub Desktop.
Merge and clean history
#! /bin/bash
# move to your local branch
git checkout local_branch
# pull the remotes
git fetch --all
# merge and squash
git merge origin/dirty_branch --squash
# create your new commit
git commit -m "New stuff"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment