Search code examples
gitqt-creator

Setup Git in Qt Creator


What are Git properties in Qt Creator about?

I've installed Qt Creator and git. There is a "General" tab in Qt Creator's "Options -> Version control", and there are a few options:

  • path to check scripts
  • path to configuration files and SSH prompt command.

Should I create these files by myself?

In "Git" tab, there is a field, "Prepend to path". Is it the path to Git? Such as /usr/lib/git?

What is the command for "Repository browser"?


Solution

  • For 64-bit Windows.

    1. Install Git for Windows.
    2. Place C:\Program Files\Git\bin in Tools > Options... > Version Control > Git > Prepend to PATH:

    enter image description here

    1. Setup your local git repository in any suitable (Git Bash for example) console (cd /c/project, git init, git add *, git commit, git remote add origin git@someserver:/some/path/to/project.git, git push).
    2. Work with your project in Qt Creator via Tools > Git > Local Repository > Commit... > Commit and Push...

    That's all. Probably you'll want to use passwordless SSH key, because Qt Creator can't easily handle SSH password entering (and storing). Some third-party tools can be used for that. If you want to remove the password from your SSH key, use ssh-keygen -p.