【问题标题】:Git over SSH using IP address on a different portGit over SSH 使用不同端口上的 IP 地址
【发布时间】:2011-05-12 07:20:17
【问题描述】:

我有一台机器想用作 Git 服务器。存储库将有 2 个贡献者。我已经在 Windows 机器的服务器上设置了一个 SSH 帐户。我非常关注http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/ 的博客和步骤。

我可以在服务器上设置 git --bare init 它确实创建了一些文件夹,但它没有 .git 文件夹 - 我认为它应该是这样的。

我使用 ssh 连接 ssh -p -port ssh://xx.xx.xxx

但是,当我尝试使用连接时

git push ssh://xx.xx.xxx:port/myrepository.git

myrepository.git 是我在服务器上创建的裸仓库。

我收到一条错误消息,提示它似乎不是有效的存储库。

请告诉我可能出了什么问题?我有一种感觉,我缺少一些 SSH 配置。我是 SSH 和 git 的新手。

谢谢

【问题讨论】:

标签: windows git ssh ip-address msysgit


【解决方案1】:

myrepository.git 在哪里?是C:\myrepository.git吗?

如果不是,那么通过查看 Tim Davis 的指南,您可能需要指定完整路径:

git push ssh://xx.xx.xxx:port/FULL/PATH/TO/myrepository.git

【讨论】:

  • 它位于 $home/my_account/myrepository.git。我试过完整路径为 ssh://xx.xx.xxx:port/home/my_account/myrepository.git 但是,home 其实是 c:/Program Files/ICW/ 你觉得呢?
  • 您正在使用的远程计算机不知道环境变量 %HOME% 在您的主机上的位置(这由用户更改...)。最好的解决方案是将共享的 git 存储库移动到另一个位置并使用上面 orip 建议的完整路径。
  • @SingleMalt - 您需要 URL 中 C:`. You can try using %20` 的完整路径,而不是“程序文件”中的空格,或者像 g19fanatic 所说的那样移动存储库。
猜你喜欢
  • 2021-12-11
  • 1970-01-01
  • 1970-01-01
  • 2011-10-01
  • 2012-02-03
  • 2014-02-14
  • 2017-12-28
  • 2014-08-06
  • 1970-01-01
相关资源
最近更新 更多