Learn from a particle physicist
Jun 11, 2015
learning
GitHub
Windows
Qt
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:
- Install GitHub for Windows. It will create a Git Shell icon on
your desktop.
- 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
- 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
- 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
- I prefer to create an empty repository using GitHub web interface, where
you can add a .gitignore and a LICENCE file easily:
- 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.
- Clone you repository in GitHub to your local machine:
- Create a new project in Qt Creator in the same directory of your
local git repository:
- Git related operations are now enabled in Qt Creator:
- Now you can do all kinds of things related to git within Qt
Creator without even opening GitHub for Windows.