Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I do not know from the online tutorial if I am properly establishing a connection with a git repository that is on a network.

All I have learned from a tutorial is how to set up a local repository, but getting data off of a network repository is knowledge I have yet to stumble upon or learn about and I wanted to save time by asking some online help forums.

I have just started using git after not using it for a while.
I have created a repository.
Then, as I was instructed, I made a “git clone” command which consisted of “git clone” followed by a path.
I expected this to get the contents of the path and put it into my repository – meaning the directory I made. This did not happen. What do I do?
How do I get a local copy of a remote work space for me to work on?

I am wondering if there is something like a "fetch" command I should be using.

The video tutorial I was looking at instructed how to make a local repository. But if I am trying to get code from a network location, how do I go about making that happen?

I was instructed at my job to run this command (copied here in pseudo code)

git clone blah-blah:/blah/git/noogie/dork_monkey/

and when I did this grom git-bash it did not produce any errors which led me to think it was the command I needed to do.

But I did this from the local directory that I used

git init

to set up as a locak repository.

I assumed that typiing a "git clone..." command would have copied all of the files on the blah-blah server over.

But it did not.

I wonder if all this might have something to do with the fact that I need to get my network up and running first.

In my File File Explorer window, when I click on the "This PC" icon on the left, I can see I have five Network locationis mapped to drive letters.

But when I click on the Network icon I get an error.

What I have tried:

I do not know if I need a formal network connection.
Posted
Updated 26-Dec-21 13:39pm
v2

1 solution

Quote:
getting data off of a network repository is knowledge I have yet to stumble upon
Often the problem with getting the data from a remote repository is that you don't know enough about the "remote location" itself. For this, you would need help from your network admin, not a Git geek. :-) No, no, don't go, hear me at least...

The thing is that you can run a git clone command to "fetch" (not the git fetch[^]) any repository that has Git initialized. The git init[^] is a different thing, but to fetch a remote repository, git clone[^] is best.

For example, let's try this Google's repository: Guava[^].
$ git clone https://github.com/google/guava orange
Try and run this command, you would see that Git would start downloading the Git contents (tree, history, etc. etc.) and put them under "orange" folder (this can be anything, you name it).

Quote:
I assumed that typiing a "git clone..." command would have copied all of the files on the blah-blah server over.
And you're not wrong. The problem would be, that the blah-blah server might just not allow everyone to copy the content. Many organizations use firewalls, network traffic controls, IP-blocking, and other techniques to prevent Internet users from accessing and copying the content; even with Git. I have used Namecheap as my domain provider for years and have hated their hosting services as they require SSH connections before I can run any command; so I would create an SSH connection, then run the commands from the window that is authenticated for the SSH tunneling, and... yeah, it's a mouthful, right?

Perhaps, you require an SSL certificate (even a self-signed one), or you need to connect to a proper VPN channel to communicate, or your Git requires credentials. Who knows? The best bet is, that when you try to run git clone ..., see what the response is. Normally, Git would render a response for failure or success. In any case, communicate this with the network administrator, or request access from an admin.

Good luck.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900