I love working with SalesLogix models in source control. Specifically with Git. However, whether you’re using Git, or some other source control system, there are certain files in a SalesLogix model that you do not want to include in your source control. Many part of the files in an exported SalesLogix model are automatically generated by the Application Architect and by the build process when you build your web platform. Having these files under source control would only complicate things when working with multiple developers since you’d each need to merge these automatically generated files with each pull/checkout from source control since they change every time.
Model Files to Exclude
Let’s take a look at which files to exclude from source control and why.
- ModelIndex.xml – This file is a temporary cache created by Application Architect as you access objects. This file can be deleted and will be automatically created again as needed. This is a volatile file and if included in source control would require constant merging with no benefit.
- ModelDeployment folder tree – The deployment folder in the model is where the Application Architect will create all of the actual SmartPart.ascx files and other deployable items from the QuickForm meta data and entities in your model. This is not to be confused with a “deployment” per se, but this is a staging area for things to be deployed that are created when you build your platform. As you create, modify, delete items in the model and then build your web platform all of the deployment files are generated based on what is in your model. Including these files in your source control system will complicate things since these files are created all over again as you build your web platform. To keep your folder structure in tact, I usually will exclude the following from source control:
- In addition to what is excluded from the SalesLogix model, using file merge tools, such as KDiff, DiffMerge, etc, you will have additional copies of files created that you’ll want to exclude. When working with Git Extensions you’ll see these copies of files with .LOCAL, .REMOTE, .BASE extensions.
Ignoring Files with Git
As I mentioned before, I love Git. To exclude files from a Git repository you simply create a text file in the root of the repository named “.gitignore” and you can add files or directories to ignore (or to not ignore by prefixing the file or directory name with a “!”). This is what the contents of my .gitignore file looks like for a standard SalesLogix model:
# Files created from merge tools
# Model files that are auto-generated
# Standard deployment files
Ignoring Files with Git Extensions for SalesLogix
To make all of this easier with working with Git for source control with a SalesLogix model, I have updated Git Extensions for SalesLogix. The menu in Application Architect now includes a menu option to edit your .gitignore, and if it does not yet exist, it will give you the option to add all of the standard entries I have mentioned above.
In addition, when you initialize a new Git repository for a model from Application Architect the .gitignore file will be automatically created for you wit the entries mentioned above. Note, when you open a model in Application Architect and click the browse button on the Git Extensions toolbar it will detect if the current model has a Git repository or not and will prompt you to create the repository if one does not yet exist.