windows - 如何在 bash/ubuntu 下通过 SSH 在 Windows 上使用 hg?

标签 windows bash ubuntu mercurial

我希望我可以把它放在我的 mercurial.ini 中:

[ui]
ssh = C:\Windows\System32\bash.exe -c ssh

因为 C:\Windows\System32\bash.exe -c ssh 看起来正常:

C:\Users\mpen>C:\Windows\System32\bash.exe -c ssh
usage: ssh [-1246AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-E log_file] [-e escape_char]
           [-F configfile] [-I pkcs11] [-i identity_file] [-L address]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-Q query_option] [-R address] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]

但是当我hg pullhg clone 时它只是挂起。有没有什么技巧可以让它工作,或者只是不允许做这样的跨操作系统的事情?

最佳答案

我猜它会提示用户信息。 (例如,你信任这个主机指纹吗)

创建一个run.bat文件:

bash -c "ssh %* 2>&1"

并将其添加到您的 ini 文件中以进行 ssh

[ui]
ssh = C:\somepath\run.bat

现在当它在 hg clone 上挂起时 - 按 ctrl C,您应该会得到一些提示问题所在的文本。

关于windows - 如何在 bash/ubuntu 下通过 SSH 在 Windows 上使用 hg?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49205089/

相关文章:

linux - 在/目录中意外使用 rm -r * 后恢复 ubuntu

python - 如何修复 Ubuntu 21.10 中的 QT 问题?

Windows 相当于 makefile 中的命令替换

arrays - 对文件中数组中的每个元素运行命令

bash - Bash中两个列表的交集

macos - 连接到 EAP-TLS wifi 网络 os x 终端

ubuntu - 有没有办法将winsock lib从windows移动到ubuntu?

c - 确定进程是否已死 - 通过 PID

c# - .NET 位图类无法打开 LinkedIn 个人资料图片 - 关于如何打开有什么建议吗?

c++ - 为以前的 Windows 平台构建我的应用程序