I need to transfer a complete repo to a new non-networked machine, preferable as a single file entity. The git bundle allows a git fetch
, git pull
style operation in a sneakernet environment but appears to assume that you already have a working version of the repo on the destination machine.
What is the right invocation to:
- Bundle all the branches in the current repo
- Start up the new repo on the destination directory, i.e. get the root commit correctly installed
I've sent a patch upstream to clarify:
`git clone` can use any bundle created without negative refspecs
(e.g., `new`, but not `old..new`).
If you want to match `git clone --mirror`, which would clone other
refs such as `refs/remotes/*`, use `--all`.
If you want to provide the same set of refs that a clone directly
from the source repository would get, use `--branches --tags` for
the `<git-rev-list-args>`.
So $ git bundle create repo.bundle --branches --tags
best matches cloning.
$ git bundle create repo.bundle --all
will provide a mirror image of your source machine, including it's remote refs.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…