Learn from a particle physicist

Jun 11, 2015 learning GitHub Windows Qt

set git shipped with GitHub for Windows in Qt Creator 
Options

Qt Creator is an IDE for writing C++ programs (mostly GUIs) with Qt library. GitHub is a cloud service where you can save your codes in the format of git repositories and collaborate with others. Qt Creator relies on external git commands to provide git related operations. GitHub for Windows provides those commands. It is very easy to tell Qt Creator to use the git commands shipped with GitHub for Windows:

  1. Install GitHub for Windows. It will create a Git Shell icon on your desktop.
  2. Right click the icon, select Propertries. In a text box labelled Target you can find the location of your GitHub for Windows installation:C:\Users\jing.liu\AppData\Local\GitHub
  3. Go to that folder and you will find a sub folder with all git commands included:C:\Users\jing.liu\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin
  4. Open your Qt Creator, select Tools menu and then Options… and follow the screen shot at the beginning of this post. Click Ok and you are done.

Work flow

  1. I prefer to create an empty repository using GitHub web interface, where you can add a .gitignore and a LICENCE file easily: add repository in GitHub
  2. Run GitHub for Windows on your desktop. You will be asked to log into GitHub and setup your local git preference if this is the first time you run it. This will also generate an SSH key pair automatically so that you can communicate with your remote repositories without typing your user name and password again and again.
  3. Clone you repository in GitHub to your local machine: clone repository in GitHub for 
Windows
  4. Create a new project in Qt Creator in the same directory of your local git repository: create Qt project in local git 
repository
  5. Git related operations are now enabled in Qt Creator: git operations enabled in Qt 
Creator
  6. Now you can do all kinds of things related to git within Qt Creator without even opening GitHub for Windows.