Skip to content

Instantly share code, notes, and snippets.

@eskil
Last active December 16, 2015 13:59
Show Gist options
  • Save eskil/5445899 to your computer and use it in GitHub Desktop.
Save eskil/5445899 to your computer and use it in GitHub Desktop.
Script to rebase -i origin/master and auto mark fixes as 'f'
#!/bin/bash
# Put in ~/bin/fixbaseedit.sh
# alias fixbase="EDITOR=~/bin/fixbaseedit.sh git rebase -i origin/master"
# You can also just make a script that does "git commit -a -m fix" and
# the rebase for you.
sed -i.old \
-e '2,$s/pick \(.*\) fixup/f \1 .../g' \
-e '2,$s/pick \(.*\) fix/f \1 .../g' \
-e '2,$s/pick \(.*\) STAEB.*/f \1 .../g' \
$1
vi $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment