Skip to content

Instantly share code, notes, and snippets.

@aaccioly
Forked from MartinWallgren/git-fixup
Last active July 7, 2025 12:38
Show Gist options
  • Select an option

  • Save aaccioly/4e724ec10d892fb0f90c93cf5cebd262 to your computer and use it in GitHub Desktop.

Select an option

Save aaccioly/4e724ec10d892fb0f90c93cf5cebd262 to your computer and use it in GitHub Desktop.
Select a fixup commit using fzf
#!/bin/sh
upstream=$(git rev-parse --abbrev-ref @{upstream} &> /dev/null)
if [ -z ${upstream} ];then
upstream=origin/master
fi
parent=$(git log --oneline ${upstream}..HEAD | \
fzf --height ${FZF_TMUX_HEIGHT:-40%} | \
cut -d' ' -f1)
git commit --fixup=${parent} "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment