Alex Rivera | Logout

What is the best way to back up an entire git repository on external disk?

Asked 2010-12-07T02:21:28.120
19

So I want to be able to back up a git repository that may have several branches onto an external hard drive and then be at a later time be able to copy it back onto my local machine and work with it as usual? I have tried simply copying the working directory folder containing the .git directory and it worked. However, I was wondering if this was the best way or if it had pitfalls later.

Edit
Report

2 Answers

3

That's about the only way to do it, short of cloning the repository onto the external disk. But either approach is approximately equivalent, except that copying your clone will preserve any repo-specific config settings.

answered 2010-12-07T02:24:41.177
1

There is no pitfall here, git is a fully distributed SCM. Copying a working copy with the .git directory is sufficient backup.

answered 2010-12-07T02:24:23.903

Your Answer