Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to clone/pull a repository in another PC using Ubuntu Quantal. I have done this on Windows before but I don't know what is the problem on ubuntu. I tried these:

git clone file:////pc-name/repo/repository.git
git clone file:////192.168.100.18/repo/repository.git
git clone file:////user:pass@pc-name/repo/repository.git
git clone smb://c-pc/repo/repository.git
git clone //192.168.100.18/repo/repository.git

Always I got:

Cloning into 'intranet'...
fatal: '//c-pc/repo/repository.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

or

fatal: repository '//192.168.100.18/repo/repository.git' does not exist

More:

  • The other PC has username and password
  • Is not networking issue, I can access and ping it.
  • I just installed git doing apt-get install git (dependencies installed)
  • I'm running git from the terminal (I'm not using git-shell)

What is causing this and how to fix this? Any help would be great!

UPDATE

I have cloned the repo on Windows using git clone //192.168.100.18/repo/intranet.git without problems. So, the repo is accessible and exist! Maybe the problem is due user credentials?

share|improve this question

closed as off-topic by sciurus, mdpc, Jenny D, Ward, Falcon Momot Jan 12 at 22:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – sciurus, mdpc, Jenny D, Ward, Falcon Momot
If this question can be reworded to fit the rules in the help center, please edit the question.

    
I'm not really sure if this question belong here, but I have seen similar questions on SF –  Tom Sarduy Jan 7 '13 at 20:51

3 Answers 3

up vote 3 down vote accepted

It depends on how you have your server configured to serve content.

If over ssh:

git clone user@192.168.100.18:repo/repository.git

or if a webserver is providing the content (http or https)

https://user@192.168.100.18/repo/repository.git

or if available via a file path:

git clone file://path/to/repo

or if the server is running the git daemon:

git clone git://192.168.100.18/repo
share|improve this answer
1  
On Windows, I'm cloning using git clone //192.168.100.18/repo/repository.git, but I logged previously on the 192.168.100.18 maching, so this is the file:// way? –  Tom Sarduy Jan 7 '13 at 21:16

The manual for git-clone says:

Git natively supports ssh, git, http, https, ftp, ftps, and rsync protocols

Note that SMB is not in the list.

When running git on Windows, the //host/path syntax works because the OS supports it natively - SMB remote paths can be used anywhere a local path can be used. That is not the case in unix, where SMB is an alien thing, and // is equivalent to / in the pathname resolution algorithm.

mount the remote filesystem, then you will have the ability to refer to it with a unix-style pathname that git (and every other tool on the system) understands.

For information on mounting smbfs: http://askubuntu.com/questions/137011/how-to-mount-a-samba-shared-folder-ubuntu-x-ubuntu

share|improve this answer

This issue seems similar to http://stackoverflow.com/questions/5200181/how-to-git-clone-a-repo-in-windows-from-other-pc-within-the-lan. Perhaps the administrative share helps alleviate the problem (e.g. //pc-name/c$/path/to/repo)

share|improve this answer
    
no, is the same case, but not the same problem, I read that thread before :/ and the repo directory is shared correctly –  Tom Sarduy Jan 7 '13 at 23:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.