How can I setup a "remote" repository on a separate drive and clone that repository to work on in another drive with git versioning control?

Viewed 60

I'm still trying to learn how to use git so bear with me.. I want to have a "remote" repository on my back up drive and just clone it onto another drive where I can develop on my stuff. Once I'm happy with what I have, I want to be able to push it back to that "remote" repository on my backup drive. Basically have github on my machine without having to put my stuff on the web. Is this even possible? If so what would be the right way to do this. Thank you.

1 Answers

Assuming your remote drive is mounted at /mount/git-repos/my-repo, you can just clone from that path:

$ git clone /mount/git-repos/my-repo

and work with the cloned repository as usual. Just make sure the remote drive is mounted before pushing.

Related