push vs. bundle vs. tar zcvf — to backup entire local .git

后端 未结 3 1830
星月不相逢
星月不相逢 2020-12-15 08:20

I can backup my local .git by pushing it to a repository in two steps:

git push --all ~/gitrepo
git push --tags ~/gitrepo

I can back it up

3条回答
  •  甜味超标
    2020-12-15 09:09

    The tar method is a possibility, but it won't check the integrity of the saved repo: you won't know if that compressed repo would work until you uncompress it and try to clone or fetch from it.

    I prefer the clone --mirror approach (with reflogs enabled in the resulting bare repo).
    And the incremental backups are then simple push.
    As debated in this old thread, a git stash before a backup might allow you to save more (index and working tree state)

提交回复
热议问题