我想知道是否有人可以深入了解为什么当我通过 SSH 连接到我们的源代码控制服务器时 SmartGit 不工作。 GitBash 表现良好。
背景:
我在网络上设置了一个源代码控制服务器,运行 MSYSGit 和 WinSSH 作为 SSH 服务器。它连接到 AD 以解析用户名等,我已经导入了所有公共(public) RSA key 等。一切正常。
我们的一个曲线球是,尽管 Git 安装在“C:\Program Files (x86)\Git”,但我们的实际源代码位于“C:\Git” ',定期备份。
我已将 WinSSH 配置为使所有 SSH session 默认为“C:\Git”作为它们的主文件夹,这很有用。当我使用 Git Bash 连接到服务器时,它默认为“C:\Git”。完美。
当我让 SmartGit(使用 SmartGit SSH 客户端)连接到同一台服务器时,使用 url:
ssh://<server>/<folder>/<repo>
我在说路径时遇到错误...
C:\Program Files (x86)\Git\<folder>\<repo>
...似乎不是存储库。嗯,是的...它应该在“C:\Git”中查找它,而不是“C:\Program Files (x86)\Git”。 p>
我不确定为什么 SmartGit 不适合这个设置,但我认为默认的 WinSSH 设置被它的 SSH 客户端绕过了,因为它完全从 'C:\Program 指定了整个路径文件 (x86)\Git'。
我的问题:
SmartGit 可能从中获取“C:\Program Files (x86)\Git”路径的任何想法?
这是我可以在某处设置的变量吗?
更多信息(更新)
SmartGit的版本是3.0.4,但是2.x也有这个问题。
我附上了(我很确定)SmartGit 应用程序日志中的失败实例:
1782732 (2012-05-10 12:18:56,653) [QThreadPoolThread-2 (smartgit.KL)] INFO smartgit.core.executable - Executing following command: "C:\Program Files\Git\bin\git.exe" ls-remote ssh://initio-dev01/INIT/INIT.Framework.git refs/heads/
1782732 (2012-05-10 12:18:56,653) [QThreadPoolThread-2 (smartgit.KL)] INFO smartgit.core.executable - in directory: null
1783049 (2012-05-10 12:18:56,970) [QThreadPoolThread-8 (smartgit.aqT)] INFO smartgit.server - received command: ssh
1786438 (2012-05-10 12:19:00,359) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.command.logging - stderr: fatal: 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository
1786438 (2012-05-10 12:19:00,359) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.core.command - fatal: 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository
1786439 (2012-05-10 12:19:00,360) [Thread-29] ERROR smartgit.ssh.trilead - com.trilead.ssh2.transport.TransportManager: Receive thread: error in receiveLoop: socket closed
1786763 (2012-05-10 12:19:00,684) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.command.logging - stderr: fatal: The remote end hung up unexpectedly
1786763 (2012-05-10 12:19:00,684) [QThreadPoolThread-6 (smartgit.cR)] INFO smartgit.core.command - fatal: The remote end hung up unexpectedly
1786772 (2012-05-10 12:19:00,693) [QThreadPoolThread-2 (smartgit.KL)] WARN sg.command.ping - 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository The remote end hung up unexpectedly smartgit.cn: 'C:/Program Files (x86)/Git/INIT/INIT.Framework.git' does not appear to be a git repository The remote end hung up unexpectedly
at smartgit.gG.a(SourceFile:86)
at smartgit.ga.a(SourceFile:63)
at smartgit.ga.a(SourceFile:53)
at smartgit.hA.a(SourceFile:57)
at smartgit.ahq.a(SourceFile:26)
at smartgit.ahl.a(SourceFile:39)
at smartgit.aL.a(SourceFile:46)
at smartgit.aD.a(SourceFile:41)
at smartgit.Kw.a(SourceFile:144)
at smartgit.KL.run(SourceFile:34)
at smartgit.Pp.run(SourceFile:65)
最佳答案
硬编码路径非常烦人,这似乎是这里的问题?!在以后的版本中修复此问题之前,也许您应该创建一个目录连接点或符号链接(symbolic link)。可能是一个(快速而肮脏的)解决方案,而不是花时间修复程序。
(必须在管理员 shell 中运行)
对于连接点:
mklink /j "C:\Program Files (x86)\GIT\<folder>" C:\GIT\<folder>
对于符号链接(symbolic link):
mklink /d "C:\Program Files (x86)\GIT\<folder>" C:\GIT\<folder>
关于git - 设置 Git/SmartGit SSH 客户端的主文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10527131/