tags:

views:

175

answers:

3

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?

+2  A: 

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

Matt Enright
I'm not sure i have access to where the clone is stored. Not sure how i pulled the original code set either.
Shaun F
I think Matt means to clone it to from compuer B ("existing server") to computer C ("another computer"). Computer A is the one you don't have access to anymore. git clone entry in manual: http://www.kernel.org/pub/software/scm/git/docs/git-clone.html
matt b
Do you have a clone on your computer locally then? You can clone from that just the same; the repositories contain all of the same information, modulo any changes since you last pulled.
Matt Enright
I don't have a clone on my computer locally no. Just on the original workstation that i originally pulled the code to.Let me edit the question with more information.
Shaun F
Yeah, based on your edit, you can clone from computer B to C, like @matt b said. That's what's meant by "distributed source control" - there's no difference between cloning from B or from A onto C, and its just as easy to add A as a remote to C later if you get access back and want to make that the 'main' upstream repository.
Matt Enright
A: 

You mean you wanna clone it to a different computer?

How about:

git clone ssh://myserver/path/to/myproject.git 
luckytaxi
+1  A: 

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

Igor Zevaka