|
Navigation Search Contact |
Using SmartGit with Real Studio projectsSmartGit is a graphical front-end for the distributed version control system Git and runs on Windows, Mac OS X and Linux. I will show here how to use it to manage revisions of REALbasic (Real Studio) projects, optionally using Arbed to show differences between revisions. The instructions here can also be applied to SmartSVN, the alternative client for SubVersion (If you start a new project and can choose between SubVersion and Git, I recommend Git as it's more modern and more capable than SubVersion). Setting up SmartGit to store your projectsChoosing the right formatYou can go two ways to store your projects for use with Git (or SVN):
If you use the VCP format, things are straight-forward. You do not even need to consider using Arbed, as the files are already in a well-readable text format that allows you to see differences between revisions fairly well. If you choose to use the other formats, however, seeing differences becomes difficult. Here, Arbed can be used to display the differences in a way that's even better than what you'll get with the VCP format. Why choose the RBP or XML formats at all? These formats are the raw and original REALbasic file formats, while VCP is a derived format that sometimes is causing problems due to bugs in the conversion code of the IDE. Sometimes, when new project items are added to the IDE, the VCP format isn't updated correctly to support the new items. In such a case you'll need to use the RBP (or XML) format or you might damage your project. (See a blog post by Bob Keeney as an example.)
Another good reason is that external items are better supported by the RBP and XML formats, in case you want to share the same project items (classes etc.) between multiple projects.
Setting up Git to manage your project revisions.No matter which format you choose, you'll use the same steps to use Git to manage your source code: With SmartGit, this step is very easy.
Now SmartGit shows you a window for the new project, with a left pane containing the folder tree and a right pane showing the files in the selected folder. The listing will probably contain a lot of files and folder you do not want to manage as revisions, such as the built application and maybe a Build folder. You should now tell Git to ignore all those items you do not need to version controlled by selecting either the entire folder or single files, and then choose from the menu "Local" -> "Ignore". I suggest not to include the ".gitignore" in the ignored items so that it gets version controlled as well. This will be convenient later if you choose to share the git project. Eventually you should only have those files listed of which you want to record updated versions. That'll be your source files (ending in ".rbp", ".xml", ".rbvcp", ".rbbas" etc.) and maybe other files such as documentation, images and even plugins (I usually store any used plugins along with each project so that I know which plugins are used by which project). Lastly, you need to commit these files to Git's repository so that Git learns the initial version of these files, letting it track any changes to them thereafter. To commit them, simply select all files (to see all files, first select the top folder in the left pane, and also make sure you've checked the "View Files from Subdirectories" option). Then press the "Commit" button in the window's toolbar. A dialog window opens in which you can enter a description. Enter something like "initial version" and press "Commit". After a few seconds, SmartGit should show an empty list (provided you've unchcked the View option for "Unchanged Files"). This empty list tells you that there's nothing changed in your project that needs to be committed to the Git repository. With that, Git is set up to manage your project. As a test, make a little change to your project, e.g. add a comment somewhere. Save the project. Then go back to SmartGit. It should now list at least one file that's marked as "Modified" in the "Working Tree State" column. Select these modified file(s) and press "Commit" again. Enter an new commit message, e.g. "test change", and press Commit. That will store the updated version of the file(s) in the Git repository (which is a hidden folder inside your chosen project folder). Viewing differences between revisionsIf you're using the VCP format, SmartGit can show you the changes between the revisions directly. Simply double click on any file that's marked "modified" and you'll get a new window in which the last commited version is compared to the currently modified version. Setting up SmartGit to use Arbed as a diff viewer for Real Studio project filesNote: Requires Version 1.4.1 of Arbed
If you're using the XML or RBP format, you can have Arbed show the differences in a nicer way.
Now, next time to double click a modified file in SmartGit, Arbed will be launched and will show the differences like this. |