我是一名独立开发人员,在本地Git存储库中工作。对于备份,我想将该存储库的确切副本发送到另一台服务器。“git push --mirror”足以备份我的存储库吗?
这样做足够吗?
git push --mirror
我这么问是因为我有时可以运行此命令两次或三次Git的告诉我:“一切了最新的”过,所以很明显它不是一个确切的镜子。这似乎是重新推动追踪分行......?
$ git push --mirror
Counting objects: 42, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (30/30), done.
Writing objects: 100% (30/30), 5.09 KiB, done.
Total 30 (delta 17), reused 0 (delta 0)
To ssh://my/repo/url
c094a10..0eedc92 mybranch -> mybranch
$ git push --mirror
Total 0 (delta 0), reused 0 (delta 0)
To ssh://my/repo/url
c094a10..0eedc92 origin/mybranch -> origin/mybranch
$ git push --mirror
Everything up-to-date
发生了什么,这是一个很好的策略吗?
编辑:我不喜欢使用类似git bundle
或.tar.bz2
档案,因为我希望备份是一个可访问的工作副本。由于我的备份服务器连接到网络并始终打开,因此在路上时,这是访问存储库的好方法。
参见:[备份本地Git仓库(http://stackoverflow.com/questions/2129214/backup-a-local-git-repository) – miku 2010-07-26 08:24:24
这是否备份引用日志以及?如果没有,那么这是一个很差的备份。 – onionjake 2014-04-07 21:52:21