I want to use git archive to make backups of my repository, but the backups created do not contain the .git folder. Is there an option to pass in to force it to include the .git folder? I mean it includes gitignore, etc anyway...Thanks.
Asked
Active
Viewed 1,461 times
1
-
If you want to back up your *repository*, you don't want to use git-archive. It's for packaging up the contents of the work tree in a specific revision. All you'll be backing up is a snapshot, not the history. Daenyth and VonC suggest bundles and bare clones, both of which are ways to back up the repository itself (the history, with all of the objects). – Cascabel Sep 16 '10 at 04:01
3 Answers
4
why not just tar
the whole thing? no need to use git archive

fseto
- 9,898
- 1
- 19
- 14
-
4Sometimes I want to share the project, including it's history but without stuff in .gitignore? – tungd Oct 06 '15 at 05:39
1
An easier option than tarring is to just make a bare repo on another machine (github is great if you don't have a spare server) and push to it. Dropbox works too, but make sure you do a bare repo and not a working copy.

Daenyth
- 35,856
- 13
- 85
- 124
1
Another option for backup is to use git bundle
See "backing up project which uses git" for a difference between:
git archive
git bundle
You can combine git bundle
(producing one file which can act as a repo of its own, and which can be cloned to restitute a fully functionning .git
repo) with DropBox if you want: See "Git with DropBox".