gitgit-bundle

How to bundle a branch


I am new to git and have done following setup:

  1. There is a repository on a server S.
  2. I cloned it to my machine A and add some changes in a branch.
  3. I just copied the repro from 2 to an usb-drive. Then walked over to machine B, which has no connection to S or A.
  4. I then used this copied repro to make some changes to the branch (on machine B).
  5. I read more about git -because there has to be some way to move my commits- and found git bundle.

Now I want move my commits from the B to A. Then from A to S but I think this will not be the problem.

I tried to follow this text and tried to call

 git bundle create commit.bundle L..H

,where L is the identifier for the last commit that is on both A and B, and H is the identifier for the last commit in B.

This gives:

fatal: Refusing to create empty bundle.

I clearly do not know how to do this right. I suppose it might have do something with me not using a bundle in my step 3 or that L and H are on a branch and I need to provid more information.

From here I know that:

git bundle will only package references that are shown by git show-ref

But I am not sure what this means. When I just type in git show-ref it gives a short list, that includes my commits H and L.


Solution

  • By using the names for the commits given in git show-ref the problem disappears.