简体   繁体   English

使用其他端口上的IP地址通过SSH进行Git

[英]Git over SSH using IP address on a different port

I have a machine that i want to use as a Git server. 我有一台要用作Git服务器的机器。 There will be 2 contributors to the repository. 该存储库将有2个贡献者。 I have set up an SSH account on the server which is a Windows machine. 我已经在Windows计算机的服务器上设置了SSH帐户。 I pretty much followed http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/ the blog and steps. 我几乎关注了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. 我感觉我缺少SSH的某些配置。 I am new to both SSH and git. 我是SSH和git的新手。

thanks 谢谢

Where is myrepository.git located? myrepository.git在哪里? Is it C:\\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

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

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