简体   繁体   English

在本地服务器上克隆/推送到Git存储库

[英]Clone/Push to Git Repository on Local Server

I have just built my first PC (Windows 7) and am setting up a Home Server. 我刚刚建造了第一台PC(Windows 7),并且正在设置家庭服务器。 I have installed Apache, PHP, MySQL on the machine and everything is running great. 我已经在机器上安装了Apache,PHP,MySQL,一切运行正常。 The server is available to all computers on my network by navigating to IPAddress:Port (using a custom defined port to avoid conflicts) in a browser. 通过在浏览器中导航到IPAddress:Port(使用自定义定义的端口以避免冲突),该服务器可用于我的网络上的所有计算机。

The last step I would like to take is get GIT up and running on the server so that I keep a local copy on my laptop etc and push/pull to the server. 我要采取的最后一步是在服务器上启动并运行GIT,以便将本地副本保留在笔记本电脑上,然后推/拉到服务器上。 I installed msysgit on the server, created a Media directory in my htdocs folder and created a new git repository there. 我在服务器上安装了msysgit,在htdocs文件夹中创建了Media目录,并在其中创建了新的git存储库。 When I navigate to the directory in explorer I can see the .git directory. 当我浏览到资源管理器中的目录时,可以看到.git目录。

Now, I have git running on my laptop (MacBook Pro) through the command line but I cannot seem to clone the repository from the server. 现在,我已经通过命令行在笔记本电脑(MacBook Pro)上运行了git,但似乎无法从服务器克隆存储库。 All of the commands that I try don't seem to be working (git clone //IPAddress:Port/Media, etc). 我尝试的所有命令似乎都不起作用(git clone // IPAddress:Port / Media等)。

I'm sure I'm missing something with access or settings but I can't seem to find anything that is pointing me in the right direction. 我确定我缺少访问权限或设置的内容,但似乎找不到任何指向正确方向的内容。 Any help or suggestions would be greatly appreciated. 任何帮助或建议,将不胜感激。

Thanks. 谢谢。

You will need to set up SSH as a server on the Windows box so it can listen for SSH client requests. 您将需要在Windows框中将SSH设置为服务器,以便它可以侦听SSH客户端请求。 Here is a link to a Stack Overflow thread on SSH servers for Windows . 这是Windows SSH服务器上的堆栈溢出线程链接

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

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