How to backup a local Git repository?

前端 未结 8 1079
伪装坚强ぢ
伪装坚强ぢ 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:25

    You can backup the git repo with git-copy . git-copy saved new project as a bare repo, it means minimum storage cost.

    git copy /path/to/project /backup/project.backup
    

    Then you can restore your project with git clone

    git clone /backup/project.backup project
    

提交回复
热议问题