I have a git repository, and a git bundle file. I can checkout the repository, and apply the bundle on one machine. I would like to use this particular machine as a mirror for this repository, along with the changes from the bundle. However when I try to clone it, the bundle changes don't seem to come across.
This is what I do on machine-A:
git clone [email protected]/repo.git
wget https://example.com/extra-upstream.bundle
cd repo
git fetch ../extra-upstream.bundle '+refs/heads/*:refs/remotes/extra/*'
This seems to work fine so far - I have the changes I expected.
On machine-B I do the following:
git clone git@machine-A:/repo
However only the upstream code is cloned, without the branches/remotes from the bundle. What am I missing?
Since you want mention that you want to create a "mirror", clone with
--mirror
, which will get you the remote-tracking branches of the remote repository as well:Alternatively, specify additional refspecs for your remote:
Or fetch them explicitly without any configuration:
Both forms will mirror the "extra" remote namespace of the remote repository locally when you fetch.