I'm trying to send someone a copy of the current state of one branch on my Git repository. He doesn't have access to the repository itself and doesn't need version control history. I would also like to send the file over email, so including excessive history will cause the file size to be too large.
I could manually clone that branch myself with --depth=1 in a new folder, then compress that folder and send it, but that seems like a roundabout way to accomplish what could be done with git-bundle. However, if I do git bundle create repo.bundle -1 HEAD
, which according to https://git-scm.com/docs/git-bundle should bundle only the 1 most recent commit, I get a 590 B file and an error when I try to clone from the bundle to test it:
error: Repository lacks these prerequisite commits:
error: 123456... # example SHA, HEAD~1
fatal: bad object 789101... # example SHA, HEAD
fatal: remote did not send all necessary objects
How can I get only the most recent version of the branch from my local repository?