How can I email someone a git repository?

后端 未结 2 1872
独厮守ぢ
独厮守ぢ 2020-11-22 09:29

I have tried:

git archive HEAD --format=zip > archive.zip

:and then I email archive.zip and at the other end they unzip archive.zip into

相关标签:
2条回答
  • 2020-11-22 09:53

    As previous answer said, git bundle is the way.

    If you want to create a bundle from using only one branch (I prefer bundling only master) and sending over e-mail, you can do something like below:

    $ git bundle create /tmp/mygitbackup.bundle master

    0 讨论(0)
  • 2020-11-22 09:55

    You could use git bundle and email one single file

    See "backing up project which uses git"

    A git bundle is just one file which can be very easily created and again imported as it can be treated like another remote.

    Once received, you can clone it or fetch from that file.

    As mentioned in "Backup of github repo", you will probably want for the first email to make your bundle with all branches:

    $ git bundle create /tmp/foo-all --all
    

    As Andreas mentions in the comments, Scott Chacon recently (March 2010) wrote a "cute" article on this topic in the ProGit blog:

    Git's Little Bundle of Joy

    0 讨论(0)
提交回复
热议问题