Skip to content

Instantly share code, notes, and snippets.

@doloopwhile
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doloopwhile/0979904bd854d2856780 to your computer and use it in GitHub Desktop.
Save doloopwhile/0979904bd854d2856780 to your computer and use it in GitHub Desktop.
git-rebase-i-peco: select rebase -i target
#!/bin/bash
set -o pipefail
set -e
HASH=$(git log --oneline | peco | cut -d " " -f 1)
if [ "$?" -ne 0 -o -z "$HASH" ]; then
exit 1
fi
git rebase -i "$HASH" $@
# install:
# * install peco if needed
# $ mkdir -p ~/bin && cd ~/bin
# $ wget https://gist.githubusercontent.com/doloopwhile/0979904bd854d2856780/raw/2d6ad7c0c07130bf594dffe941b2535dde9d6569/git-rebase-i-peco
# $ chmod +x ~/bin/git-fixup-peco
# $ git config --global alias.fp fixup-peco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment