Skip to content

Instantly share code, notes, and snippets.

@aboyett
Created July 18, 2014 21:18
Show Gist options
  • Save aboyett/fe84243c3f3ff997e02a to your computer and use it in GitHub Desktop.
Save aboyett/fe84243c3f3ff997e02a to your computer and use it in GitHub Desktop.
Automated squash of all commits since commit X
#!/bin/sh
base=$1
export EDITOR="sed -i '2,$ s/pick/squash/;/Change-Id: / {d}'"
git rebase -i $base
@aboyett
Copy link
Author

aboyett commented Jul 18, 2014

The "/Change-Id: /" deletion omits any gerrit change-ids from the resulting commit message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment