Last active
July 14, 2023 06:43
-
-
Save doloopwhile/fba6a6b4748b740f7b0a to your computer and use it in GitHub Desktop.
git-fixup-peco: select fixup target with peco
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 commit --fixup "$HASH" $@ | |
# install: | |
# * first, install peco if needed | |
# | |
# $ mkdir -p ~/bin && cd ~/bin | |
# $ wget https://gist.githubusercontent.com/doloopwhile/fba6a6b4748b740f7b0a/raw/git-fixup-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