简体   繁体   English

我无法在自己的git服务器中克隆存储库

[英]I can't clone my repository in my own git server

I can't clone my repository 我无法克隆我的存储库

I'll explain the steps what I've done 我将解释我已完成的步骤
1) I'm using windows 8 1)我正在使用Windows 8
2) Run Git Bash 2)运行Git Bash
3) $mkdir git_ball 3)$ mkdir git_ball
4) $cd git_ball 4)$ cd git_ball
5) $git init, returns Initialized empty Git repository in c:/Users/user1/git_ball/.git/ 5)$ git init,在c:/Users/user1/git_ball/.git/中返回已初始化的空Git存储库
6) $ls > list.txt 6)$ ls> list.txt
7) $git add . 7)$ git添加。
8) $git commit -m 'creation of list.txt' 8)$ git commit -m'创建list.txt'
9) $git config push.default matching 9)$ git config push.default匹配
10) $git remote add origin /c/Users/user1/git_ball 10)$ git远程添加源/ c / Users / user1 / git_ball
11) $git config http.sslVerify "false" 11)$ git config http.sslVerify“ false”
12) $git push origin, it gives: everithing up-to-date 12)$ git push origin,它提供:最新的
13) $cd .. 13)$ cd ..
14) $git clone git://192.168.48.189/~/git_ball git_ball2 , (192.168.48.189 is the IP of my local machine) 14)$ git clone git://192.168.48.189/~/git_ball git_ball2(192.168.48.189是我的本地计算机的IP)
it gives: Cloning into 'git_ball2'... fatal: unable to connect to 192.168.48.189: 192.168.48.189[0: 192.168.48.189]: errno=No such file or directory 它给出:克隆到'git_ball2'...致命:无法连接到192.168.48.189:192.168.48.189 [0:192.168.48.189]:errno =没有这样的文件或目录

I don't know what is missing, I want to clone git_ball using my IP, can you help me about this case. 我不知道缺少什么,我想使用我的IP复制git_ball,在这种情况下您能帮我吗? The idea also is cloning git_ball from another PC into the same LAN network using my IP. 这个想法也是使用我的IP将git_ball从另一台PC克隆到同一LAN网络中。

Thanks 谢谢

You missed to configure a remote repository. 您错过了配置远程存储库的操作。 Have a look at this link: http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/ . 看一下此链接: http : //thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/ It is for Linux, but it seems you are using git bash so it should work. 它适用于Linux,但似乎您正在使用git bash因此它应该可以工作。

Basically, you have to configure two repository on your local machine: the remote and the local repo. 基本上,您必须在本地计算机上配置两个存储库:远程存储库和本地存储库。 To configure the remote repository: 要配置远程存储库:

  1. mkdir remote-repo.git
  2. cd remote-repo.git
  3. git init --bare

At this point, you can repeat your procedure to create a local repository, where at point 10 you set the remote to point at remote-repo.git . 此时,您可以重复此过程以创建本地存储库,在第10点处,将远程设置为指向remote-repo.git

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM