Reputation: 110570
I have a git repository in 1 hard drive. And I would like to relocate that to a different hard drive. What is the safest way to do that? 1. cp -r? 2. tar ball?? 3. git clone (but what is the URI for that)?
I was concern if git repository contains absolute path so that 'mv' to a new directory will break git.
Thank you.
Upvotes: 3
Views: 2566
Reputation: 1324607
The more general solution is to use git bundle
in order to:
git clone /my/new/drive/myrepo.bundle repo2
That is not cessary in your scenario, but having one file saving everything can come in handy.
Upvotes: 1
Reputation: 53944
There is no problem in reallocation a git repo ... just mv
it.
Pay attention to surrounding jobs that could use it (maybe you gave git-daemon
a path to it?). But the repository itself can safely be moved around.
Upvotes: 6