I'm posting a self-answer because I know some of my colleagues will be googling this soon. We sometimes need to distribute bundle files which are baselined on master and hence only contain the particular branches explicitly included when it was created. For example, the distributor does:
git bundle create ../file.gitbundle master..feature/aunit_reporters
The problem is, after receiving a bundle file, doing git pull ../file.gitbundle
gives:
fatal: Couldn't find remote ref HEAD
I've verified the bundle file should be applicable, by:
git bundle verify ../file.gitbundle
The bundle contains this ref:
4f969119b208b71f4893222810600862 refs/heads/feature/aunit_reporters
The bundle requires this ref:
fd9801b79b56f5dd55ab1e6500f16daf
and git show fd9801b79b56f5dd55ab1e6500f16daf
correctly displays the commit needed, instead of giving fatal: ambiguous argument '[commit-hash]': unknown revision or path not in the working tree
, which would signal that I don't have the necessary baseline commit.