How to backup a local Git repository?

前端 未结 8 1069
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 08:08

I am using git on a relatively small project and I find that zipping the .git directory\'s contents might be a fine way to back up the project. But this is kind of weird bec

8条回答
  •  抹茶落季
    2020-11-22 08:43

    Found the simple official way after wading through the walls of text above that would make you think there is none.

    Create a complete bundle with:

    $ git bundle create  --all
    

    Restore it with:

    $ git clone  
    

    This operation is atomic AFAIK. Check official docs for the gritty details.

    Regarding "zip": git bundles are compressed and surprisingly small compared to the .git folder size.

提交回复
热议问题