什么是配置Qt Creator使用Git的正确方法? [英] What is the correct way to configure Qt Creator to use Git?

查看:1330
本文介绍了什么是配置Qt Creator使用Git的正确方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试将Git for Windows与QT Creator 2.8一起使用,并且失败了。我在bitbucket上创建了一个存储库,遵循bitbucket 101教程,并且当我使用Git Bash,甚至Git GUI时,一切都运行顺利。 PATH变量设置正确,一切工作在Qt之外。但是,在尝试配置Qt Creator时,我无法访问远程存储库。给出的错误是:


16:25在C:\ Users(...)中执行:C:\程序文件
(x86)\Git\cmd\git.exe拉命令'C:\程序文件
(x86)\Git\cmd\git.exe'没有响应超时限制(60000
ms)。

几乎我发现的所有内容都告诉我配置PATH,而这应该导致一切运行正常,但我的路径设置正确(我可以键入ssh从Windows命令提示符,它的工作原理)。 Qt Creator文档( http://qt-project.org/doc/qtcreator-2.8 /creator-version-control.html )告诉我,我应该


选择工具>选项>版本控制> Git 。选择
环境变量和设置HOME环境变量检查
盒子。


code>设置HOME(...)框被选中,但没有环境变量框。 SSH提示符命令设置为 C:\程序文件(x86)\Git\bin\ssh.exe ,但我已尝试将其设置为几乎每个程序放在 \git\bin git \ cmd 上,但没有成功。我在这里找到了答案,告诉我使用某些版本的win-ssh-askpass或win-ssh-agent,但是这些要么需要Cygwin,要么来自可疑来源。


  1. 安装Windows(msys)git:select 只添加Git给PATH。这将 Git \ cmd 目录添加到系统/用户范围的PATH中,这是安全且非常有用的。


  2. 不要在Qt Creator中为git输入任何内容。因为git和Qt Creator之间的交互性有限,所以可能是最重要的:确保你的远程主机是知道你的SSH密钥(所以你不需要输入密码,我不认为Qt Creator可以处理这个密码,我相信这是你的情况出了问题),并确保你的SSH配置文件包含(可以通过在命令行中运行 git clone git push 来检查) git bash,只是一个简单的 cmd ,这可以确保您的环境与Qt Creator所看到的环境相似。

  3. >

    我强调没有别的东西需要设置,所以如果你这样做了,你可能已经破坏了应该与上述步骤一致的东西。


    I'm trying to use Git for Windows together with QT Creator 2.8, and failing miserably. I created a repository on bitbucket, following the bitbucket 101 tutorial and everything runs smoothly when I use Git Bash, or even Git GUI. The PATH variable is set properly, everything works outside Qt. However, when trying to configure Qt Creator, I cannot access the remote repository. The error given is:

    16:25 Executing in C:\Users(...): C:\Program Files (x86)\Git\cmd\git.exe pull The command 'C:\Program Files (x86)\Git\cmd\git.exe' did not respond within the timeout limit (60000 ms).

    Almost everything I have found tells me to configure PATH, and that should cause everything to run ok, but my PATH is set correctly (I can type ssh from the windows command prompt and it works). The Qt Creator documentation (http://qt-project.org/doc/qtcreator-2.8/creator-version-control.html) tells me that I should

    "Select Tools > Options > Version Control > Git. Select the Environment Variables and the Set "HOME" environment variable check boxes."

    The set "HOME"(...) box is checked, but there is no "Environment Variables" box. The SSH prompt command is set to C:\Program Files (x86)\Git\bin\ssh.exe, but I have tried setting it to almost every program on \git\bin and git\cmdwithout success. I have found answers here that tell me to use some version of win-ssh-askpass or win-ssh-agent, but those either require Cygwin or come from dubious sources.

    解决方案

    What I have always done:

    1. Install Windows (msys)git: select "only add git to PATH". This adds the Git\cmd directory to system/user-wide PATH, which is safe and very useful.

    2. Don't enter anything in Qt Creator for git. It's in PATH, so it "just works".

    3. Probably the most important due to the limited interactivity between git and Qt Creator: make sure your remote host is aware of your SSH key (so you don't need to enter a password, I don't think Qt Creator can handle that, and I believe this is what's going wrong in your case), and make sure your SSH config file contains the IP of the host as trusted (you can check this by running a git clone or git push from the commandline (not "git bash", just a plain cmd. This ensures your environment is similar to what Qt Creator sees.

    I stress that nothing else needs setting up, so if you did, you might have broken something that should work with the above steps.

    这篇关于什么是配置Qt Creator使用Git的正确方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆