Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
Qt Creator 2.8, git push and Macintosh
I was trying to access my remote git repository, after successfully creating one locally. I'm running Qt Creator 2.8 on Mac 10.7.5. My first problem was this error:
bq. error: cannot run ssh-askpass: No such file or directory
fatal: could not read Username for 'https://github.com': Device not configured
As it turns out, there's no ssh-askpass for Mac OS 10.7. So...
Big confusion: The 2.8 doc that I could find doesn't mention this problem. In fact, it doesn't mention the Mac at all. It does mention Linux though, in the context of ssh-askpass, which gave me some clues. As a side note all the pulldown menu descriptions don't apply to the Mac, since they all refer to Tools->Options, whereas on the Mac it's all off the Qt Creator->Preferences menu. But you probably know that already...
Next, I found a sneaky way someone found to implement ssh-askpass for the Mac. It's kind of convoluted (it uses a bash script and Applescript). And unfortunately, it doesn't work from within Qt Creator, and fails with this error:
bq. 129:319: execution error: Can’t get application missing value of «script». (-1728)
error: unable to read askpass response from '/usr/libexec/ssh-askpass'
I'm guessing the Applescript makes some assumptions about the environment that aren't true in Qt Creator. If anyone is interested, the script can be found here: https://github.com/markcarver/mac-ssh-askpass I don't know enough Applescript to figure out what could be going wrong myself.
So, my big question is: Can this be made to work on the Mac? Is it a known issue? Is it planned for a future release? Has anyone else seen this?
It'd be way more convenient to use this feature from within Qt Creator, but I can go to the command line if I have to. And if this functionality isn't ready for prime-time yet, could the option "Tools->Git->Remote Repository" be greyed out?
Thanks for reading, and for any help or suggestions anyone can provide.
git push does work on mac in general.
My guess is that your ssh key requires a passphrase or something. Creator in general does not really work well with user-interaction during version control operations:-/ This is due to using the command line tools and it being hard to find out when those block to wait for a password instead of just sitting their waiting for data from the server or whatever.
You could work around this problem with ssh-agent (which will cache be passphrases for your ssh keys for a session) or by removing the passphrase altogether (which of course has some security implications! OTOH, if somebody can read the key files stored in your account then you are in trouble anyway).
Hi again Tobias! :)
I'm using GitHub, which as far as I can tell requires a userid and password. The cobbled-up ssh-askpass I was using was supposed to get around the terminal I/O problem by displaying a GUI prompt for the credentials, but there's something wonky in the LotusScript running from within Creator which is preventing it from working.
I'll look at ssh-agent, which looks a little daunting at first, but maybe I can bend it to my will.
Github does not require a passphrase on the keys used and can be used fine from Qt Creator.
I have an account on github, too, so I am pretty sure it actually works (even though I use the command line a lot and mostly work with Qt's gerrit).
Hmmmm... you must have something set up differently. When trying to push from Creator, I get the message as seen above, where it's trying to run ssh-askpass to ask for a password. If I run from the command-line, I get:
So it's asking me for username (and then password) for github.
I don't know what the difference is... I also need a username and password to log in to the github.com website.
Generate an SSH key and register it with github. Then use SSH to access github.
That also has the nice benefit of being way faster than going via http(s)!
After some poking (and prodding) around, I got all the SSH key and registry stuff done, and voílla, it all works! Thanks!