PDA

View Full Version : Duplicate a Qt Creator project



Coises
18th December 2009, 18:03
What’s the simplest foolproof way to duplicate a Qt Creator project?

In more detail: I have a project at a certain stage of development. Before adding more complexity, I want to duplicate the project and work on the duplicate, so I can compare any performance problems or bugs I encounter to see if they were introduced by the new code or were already present in the “base” version (as well as preserving the possibility of an easy retreat to the older version if things go badly).

Up to now, I’ve been copying the folder containing the source and build folders to a new location, then doing search and replace for the project and folder names in the copied .pro and .pro.user files with a text editor. Is there a more straightforward (and less error-prone) way?

JD2000
18th December 2009, 19:18
Being a simpleton, under Windows I just make a copy of the project folder before I try anything exotic. If it goes wrong I simply delete the project folder and rename the copy.


You could set up your PC to dual boot with Linux.
Under linux there are a number of code management systems that can be freely downloaded - GIT, Subversion etc (there may also be windows versions) these maintain a full change history so you can roll backwards and forwards between different iterations.

Lykurg
18th December 2009, 20:25
Up to now, I’ve been copying the folder containing the source and build folders to a new location, then doing search and replace for the project and folder names in the copied .pro and .pro.user files with a text editor. Is there a more straightforward (and less error-prone) way?

Use a version control system like SVN or git which seems to become very popular last days.

jpujolf
20th December 2009, 18:24
Under linux there are a number of code management systems that can be freely downloaded - GIT, Subversion etc (there may also be windows versions) these maintain a full change history so you can roll backwards and forwards between different iterations.

Also in Windows : TortoiseSVN (http://tortoisesvn.tigris.org/) / Tortoisegit (http://code.google.com/p/tortoisegit/)

Use any SCM you feel confortable. It's useful and will save you a lot of pain. :D

wysota
20th December 2009, 18:32
For such a simple usecase I'd suggest subversion (or even cvs) and not git which is a little harder to grasp for beginners.

squidge
20th December 2009, 19:38
Personally, I use TortoiseSVN on Windows. I prefer to have a seperate repository for each project, so my directory structure is like:

<projdir>/Repo
<projdir>/Branch
<projdir>/Trunk

Where 'repo' is the storage area for SVN, Branch is for my experimental, learning and new features, and Trunk is the latest "stable" version. I create all the functionality in the branches, and then merge the changes into the trunk as they work.

It makes tracking changes very easy, and if you decide to abandon a feature for whatever reason, you can just copy the trunk to another branch and work on something else, going back to the former whenever or never.

Like others, SVN is intended to use a server, but since there's only ever me using it, I just use a local directory and its quite happy. It also means I can just backup the "repo" dir and ignore the rest, and is typically much smaller as its configured to ignore all the non-essential files and files which can be easily rebuilt.

[ I don't know if this is the best way to use a VCS, but it's how I use it ]