Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the moment our git repositories (hosted on an internal server) are being backed up when the entire Virtual Machine that they are sitting on gets backed up.

Is it enough to literally copy those files onto another area if I want another backup option or is there a better way to do it in git.

I am worried that if I just do a copy and paste there could be some information copied that makes the local branches of git spazz out if they try and commit to a restored repository.

share|improve this question
up vote 6 down vote accepted

Dude, its GIT. git clone ssh://myserver/path/to/git/repo.git. But if you don't buy that, or you want to be particularly paranoid, grabbing the contents of the entire folder should work, as long as you catch the .git directory.

share|improve this answer
I didn't want to just take a clone of it somewhere else because then surely if the original repository gets deleted I have a whole load of clones not being able to talk to one place? Maybe I am over thinking it a bit. – Toby Aug 12 '10 at 13:38
+1 - Yep, Git isn't like Windows. It doesn't scatter information all over the place (registries, system directories, or any of that BS). Everything is in the .git directory. Copy that and you have a complete backup. – Dan Moulding Aug 12 '10 at 13:40
@Toby: There is nothing special about the repository on your server. Every clone is just as capable of being the "one place". All cloned repositories are equals (and all branches are equals, for that matter; i.e. there is nothing special about master). If your server repository is a "bare" repo, you can recreate the bare repo from a non-bare clone, by using git clone --bare. – Dan Moulding Aug 12 '10 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .