Git repository from one machine to another

Viewed 38343

So I have a git repository that i pulled at one point and that repository resides on a server. I don't have access to the original repository that I pulled it from. How do i get the code from the existing server to another computer?

EDIT 1: So here's what it looks like:

  • COMPUTER A: The git repository that I originally checked out from. I don't have access to this anymore.
  • COMPUTER B: A shared server that I have the code checked out on.
  • COMPUTER C: A Local laptop.

Can i just do a simple copy of that directory without using git, or can I use git to clone if from B to C?

7 Answers

You can either pull from the network location or copy the entire directory(containing .git folder) accross to the other computer.

You can just clone it from the server, assuming you have access to where the clone is stored - the power of distribution ;)

If anyone has any issues with cloning, I used simply this, on the machine you want app to be cloned to:

  1. in CMD go to folder where you want your app to be cloned to, for example cd C:/my_apps/
  2. login to github and go to app you want to clone, press green button "Clone or Download", you will see SSH link, copy it.
  3. in CMD run git clone git@github.com:user/my-app.git (use SSH link you copied)

Done

You mean you wanna clone it to a different computer?

How about:

git clone ssh://myserver/path/to/myproject.git 
Related