git将Windows推送到Windows [英] git push windows to windows

查看:94
本文介绍了git将Windows推送到Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个设置,在装有cygwin的Windows机器上,我将linux服务器添加为远程源,然后在配置了SSH密钥后就可以推送更改.

I currently have a setup where on my windows machine with cygwin I added my linux server as a remote origin where I can then push my changes as I have my SSH keys configured.

git add remote origin ip@path.git
git push origin

我如何在Windows机器上执行此操作,就像托管SSH服务器一样简单,如果可以的话,建议您这样做?

How would I do this to my windows machine is it as simple as hosting an SSH server and if so which do you recommend?

推荐答案

听起来好像您希望能够推送到Windows计算机上的存储库,所以git daemon和git协议对您来说还不够.如果您需要能够推送到存储库,则可以使用以下选项:

It sounds as if you want be able to push to the repository on a Windows machine, so git daemon and the git protocol won't be enough for you. If you need to be able to push to the repository you're left with these options:

  1. 在Windows框中运行SSH服务器.您可以找到使用Cygwin进行此操作的各种指南,例如这一个.一种替代方法是使用mSysGit,在这种情况下,您可以在此堆栈溢出问题中追逐引用: sdorra的答案暗示SCM经理可以让您执行此操作,但是我对此没有任何经验.但是,智能HTTP实际上只是由称为git-http-backend的二进制文件提供的,您可以在CGI上使用它.该二进制文件分布在mSysGit中,因此您可以使用Web服务器进行设置-例如,有一个教程介绍了如何使用Apache
  1. Run an SSH server on your Windows box. There are various guides you can find for doing this with Cygwin, e.g. this one or this one. An alternative is to use mSysGit, in which case you could chase the references in this Stack Overflow question: Setup a Git server with msysgit on Windows
  2. Use git's "Smart HTTP" protocol - sdorra's answer implies that SCM-manager lets you do this, but I've no experience of that. However, Smart HTTP is essentially just provided by a binary called git-http-backend that you can use over CGI. This binary is distributed in mSysGit, so you could set that up with a web server - for example, there's a tutorial on doing that with Apache here

另一种选择是将远程计算机安装为本地驱动器,并使用file:协议将其添加为远程计算机.

Another alternative is to mount your remote computer as a local drive and add it as a remote using the file: protocol.

这篇关于git将Windows推送到Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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