Samir Benmendil <me@xxxxxx> writes: > It is impossible to run git commands affecting a different repo from > within a `git rebase --exec` because in that environment the `GIT_DIR` > and `GIT_WORK_TREE` variables are set and inherited by any commands > run as part of `git rebase --exec`. If the user wants to work in a different repository, the environments that tells Git about the original repository can be unset to do so, which is a very much deliberately designed behaviour, primarily to help those who run "git rebase" from a subdirectory of the project.