windows Git over SSH 使用不同端口上的 IP 地址
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4219688/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git over SSH using IP address on a different port
提问by SingleMalt
I have a machine that i want to use as a Git server. There will be 2 contributors to the repository. I have set up an SSH account on the server which is a Windows machine. I pretty much followed http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/the blog and steps.
我有一台我想用作 Git 服务器的机器。存储库将有 2 个贡献者。我已经在作为 Windows 机器的服务器上设置了一个 SSH 帐户。我非常关注http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/的博客和步骤。
I can set up git --bare init on the server it does create some folders but it does not have .git folder - which I am thinking is how it is supposed to be.
我可以在服务器上设置 git --bare init 它确实创建了一些文件夹,但它没有 .git 文件夹 - 我认为它应该是怎样的。
I connect to ssh using ssh -p -port ssh://xx.xx.xxx
我使用 ssh -p -port ssh://xx.xx.xxx 连接到 ssh
However, when I try to connect using
但是,当我尝试使用连接时
git push ssh://xx.xx.xxx:port/myrepository.git
git push ssh://xx.xx.xxx:port/myrepository.git
myrepository.git is bare repository that I created on the server.
myrepository.git 是我在服务器上创建的裸仓库。
I get an error saying it does not seem to be a valid repository.
我收到一条错误消息,说它似乎不是一个有效的存储库。
Please tell me what could be wrong?? I have a feeling that I am missing some configuration with the SSH. I am new to both SSH and git.
请告诉我可能有什么问题??我有一种感觉,我缺少 SSH 的一些配置。我是 SSH 和 git 的新手。
thanks
谢谢
回答by orip
Where is myrepository.git
located? Is it C:\myrepository.git
?
myrepository.git
位于哪里?是C:\myrepository.git
吗?
If not, then from looking at Tim Davis's guide, you may want to specify the full path:
如果没有,那么通过查看 Tim Davis 的指南,您可能需要指定完整路径:
git push ssh://xx.xx.xxx:port/FULL/PATH/TO/myrepository.git