git bundle
is a newer command which allows the creation of an archive to be shared with a remote machine. The git bundle
is more flexible in that it allows incremental updates and merging of different branches. However, you can create a bundle that use a complete specification, such as master
.
A downside is that the remote machine also needs git. The bundle is a 'pack' file and the files would need to be 'checked out' from the bundle to create a working directory on the remote (as opposed to tar). The set of machines with tar && git
and !tar && !git
is much larger than tar && !git
and !tar && git
. Ie, the machine likely has both or neither. Especially as you would intend to build source.
For Windows machines which likely have neither. You can use the 'zip' form.
git archive -o ../archive.zip --format=zip HEAD
zip -ur ../archive.zip .git/
.. and you have my condolences.