Windows服务器上的自主宿主远程git存储库 [英] Self-host remote git repository on Windows server

查看:190
本文介绍了Windows服务器上的自主宿主远程git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的本地网络上有一台计算机,指定为'服务器',运行Windows XP,我们保留共享文件夹和所有应该可见的东西。



我如何创建远程Git存储库,并将其设置为让本地网络上不同计算机上的不同人员可以进行推/拉操作?



不管用哪些协议 - http:// ssh:// 文件:// git:// 都可以。

解决方案编辑:我最近发现关于 Bonobo Git Server - 它是一个免费的开放源码软件,源代码为Windows和IIS的Git Server,并获得了MIT许可证的许可。我还没有测试过它,但你可以试试看。



还有这个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

 

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆