Something went wrong. Try again.
Mirroring: https://github.com/MunifTanjim/scripts.sh
Something went wrong. Try again.
scripts.sh git-fixup
316 B · 14 lines
at main
123456789101112131415#!/usr/bin/env bash
commit="$(git log -n 100 --pretty=format:'%h %s' --no-merges | fzf | cut -c -7)"
if test -z "${commit}"; then echo "fixup aborted!" exit 1fi
if [[ "${commit}" = "$(git rev-parse HEAD | head -c 7)" ]]; then exec git commit --amend "$@"else exec git commit --fixup="${commit}" "$@"fi