Re: Git rebase --exec cannot run git commands affecting other repos
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 10, 2019, 18:26 UTC
- Message-ID
- <xmqqlg3s2wu8.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20190110161904.23fwbrgg7blyx3nj@uh-nuc001>
Samir Benmendil <me@rmz.io> 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.