Let machine M be the Main machine with the repo, and A the Auxiliary machine which wants to help out.
- Machine M creates bundle with complete repo:
git bundle create repo.bundle HEAD master
- M sends
repo.bundle
to A. - A clones repo from bundle:
git clone repo.bundle repo
- A checks with
git log --oneline master ^origin/master
that the correct commits are shown that are added. 2. A puts them in a bundle with
git bundle create commits.bundle master ^origin/master
Note that both master
and origin/master
could be replaced with commit refs.
- A sends bundle to M, M optionally checks bundle with
git bundle verify commits.bundle
- M pulls commits to new branch
other-master
with
git pull commits.bundle master:other-master
- M could merge the branch.
M could add the bundle file as a remote, if the filename is always the same.
M would git remote add bundle commits.bundle
where bundle
is the name of the remote. Beware that the path commits.bundle
is relative to the repository top level!
M can then git pull bundle
.