How to use version control with Qt Creator's project settings with many users?
When using Qt Creator with qmake projects, let’s say
example.pro, then Qt Creator’s own configuration is normally stored in
example.pro.user file. But this file contains user-specific settings, so if many people are working on the project, it is not a good idea to commit it to shared version control repository. Still, this file often contains complex settings for deployment and environment variables, and it would be very good to store these to version control.
Is there a way to store personal project specific Qt Creator settings in version control, and otherwise share them, so that settings of different developers do not get mixed up?
One Solution collect form web for “How to use version control with Qt Creator's project settings with many users?”
You can use
QTC_EXTENSION environment variable. So if you normally have
Then having environment variable
When you launch Qt Creater will instead make it use file
I’m not sure if it is documented anywhere, but it is implemented in this source file (updated May 2015) and has been around since 2011 at least.
To clone settings for new user, simply copy a settings file to a new name, and set the environment variable to match the one you want. However, I don’t know of an easy way to merge changes after that, other than manually copy-pasting (either with two Qt Creators open at the same time, or by opening the XML files as text).
Then there is also a way to share settings by manually creating
example.pro.shared file (configurable with
QTC_SHARED_EXTENSION environment variable, same way as user specific settings). It is usually created by copying a .pro.user file and then editing it to remove non-shared parts, as documented here (updated May 2015).