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

后端 未结 3 1831
星月不相逢
星月不相逢 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 08:59

    Regarding tar: It saves everything: the config (remote URLs), the reflogs, etc. You might want the reflogs if you accidentally do something really stupid in your repository and your hard drive crashes shortly afterwards. Far-fetched, but tar is easy and it does everything. Use tar for making backups, use git push for making mirrors. These are different kinds of tasks.

    Regarding compression: I have a 27M git repo, almost entirely plain text, and the .tar.gz is... also 27M. That's not a whole lot of savings.

提交回复
热议问题