For some reason neither environment variables nor -c is passed to the prepare-commit-msg hook when rebasing. Other parameters (e.g. -C /path/to/repo) are passed correctly/it's running the command in the correct repo Reproduction: 1) Create a prepare-commit-msg hook with content echo "prepare-commit-msg hook" echo "$FOO" git config --get hooks.foobar exit 1 2) rebase a branch with conflicts. After resolving a conflict run: FOO=bar git -c hooks.foobar=hello rebase --continue The hook is executed but neither $FOO nor the config are set (both echo an empty line) Output: prepare-commit-msg hook Expected output: prepare-commit-msg hook bar hello Git 2.51.0