Windows服务器上的自主宿主远程git存储库 [英] Self-host remote git repository on Windows server
问题描述
我们的本地网络上有一台计算机,指定为'服务器',运行Windows XP,我们保留共享文件夹和所有应该可见的东西。
我如何创建远程Git存储库,并将其设置为让本地网络上不同计算机上的不同人员可以进行推/拉操作?
不管用哪些协议 - http://
, ssh://
,文件://
, git://
都可以。
还有这个CodeProject文章 - 一步一步在Windows上使用CopSSH + msysGit设置Git服务器并将Git与Visual Studio集成
老回答:最后,我做了@meagar建议 - 我创建服务器上的共享文件夹,并且我遵循此教程,关于使用Git Gui的部分。 注意我们使用pushd / popd,因为CD不支持UNC路径:
pushd \\\ \\ remote-pc \SharedDocs\MyRemoteGitRepo1
git init --bare
popd
现在您只需将本地仓库连接到远程仓库即可。 注意,您需要对 git remote add origin
使用正斜杠,否则它将无法工作:
cd C:\Workspace\MyLocalGitRepo1
git remote add origin // remote-pc / SharedDocs / MyRemoteGitRepo1
$ c $最后你可以把你的工作推到远程仓库:
git push origin master
We have a computer on our local network designated as 'the server', that runs Windows XP, where we keep the shared folders and stuff that should be visible to all.
How do I create a remote Git repository on it, and setup it so different people on different computers on the local network can pull/push?
I don't care which protocols are used - http://
, ssh://
, file://
, git://
are all fine.
解决方案 Edit: I recently found about Bonobo Git Server - it is a free and open-source Git Server for Windows and IIS, licensed with an MIT license. I haven't tested it myself yet, but you can give it a try.
There is also this CodeProject article - Step by Step Setup Git Server on Windows with CopSSH + msysGit and Integrate Git with Visual Studio
Old answer: In the end, I did as @meagar suggested - I created a shared folder on the server, and I followed this tutorial, the part about using Git Gui. Note that we use pushd/popd because CD does not support UNC paths:
pushd \\remote-pc\SharedDocs\MyRemoteGitRepo1
git init --bare
popd
Now all you need to do is connect your local repo to remote one. Note that you need to use forward slashes for git remote add origin
, or it won't work:
cd C:\Workspace\MyLocalGitRepo1
git remote add origin //remote-pc/SharedDocs/MyRemoteGitRepo1
And finally you can push your work to the remote repo:
git push origin master
这篇关于Windows服务器上的自主宿主远程git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!