Let's say I have a
git repo on a limited disk partition (say, a thumbdrive).
Let's say that my last push to that repo failed because the current partition got fully filled.
Let's say I try to reclaim some space with
git gc; then
git gc too will fail with:
$ git gc --prune=now fatal: failed to write ref-pack file: No space left on device error: failed to run pack-refs
Now, on the same machine, I have another partition, which has plenty of space; I'm aware that I could clone this repo there, and run
gc there, and then copy back/ write over the repo from the another partition to the first partition.
But I was wondering: instead, is there a way, I could instruct
git to use "another partition" for whatever temporary files it needs to write, while I call
git gc within the repo on the original partition - with the result that after the operation is complete,
git would have deleted the temporary files on the "another partition"; and it would have modified/deleted/added all necessary files in the "original partition" repo (effecting the space reclamation, if it is possible)?