Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the correct way to configure Qt Creator to use Git?

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.

like image 811
vrios Avatar asked Dec 02 '13 19:12

vrios


People also ask

How do I connect git to QT?

Open Qt and navigate to Options under the Tools menus. As shown below, navigate to Version Control and select Git. Paste the file location from earlier into the text box labeled “Prepend to PATH:”. Once this is done, you'll be able to use Git in Qt Creator.

What is Qt Creator used for?

Qt Creator is a cross-platform integrated development environment (IDE) built for the maximum developer experience. Qt Creator runs on Windows, Linux, and macOS desktop operating systems and allows developers to create software across desktop, mobile, and embedded platforms.


1 Answers

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.

like image 156
rubenvb Avatar answered Oct 20 '22 18:10

rubenvb