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 using git bundle.
I can back it up by simply copying the entire directory or archiving it (compressed!):
tar -zcvf gitrepo.tgz .git
And there are probably additional ways to backup an entire local .git.
The question now is whether they are really equivalent? (for example, the logs
subdirectory isn't pushed)
What are the advantages of the git push
method vs. git bundle
?
Can tar -zcvf
be considered "the perfect git backup"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…