我是一名獨立開發人員,在本地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