Login / Register  search  syndication  about

          Ryan Farley's Blog

Ryan Farley on .NET Development with a focus on CRM Development for SalesLogix

Git for the SalesLogix Developer - Using the .gitignore to Exclude Files in Your Model

When using Git, or really any source control system, you don't want everything in your SalesLogix model to be under source control. There are some files that the Application Architect uses for it's own purposes and volatile files that have no importance for your purposes and are recreated as needed. These files that change often with no importance to what you're working on can make things difficult when working with source control since every time a developer pushes changes, that are pulled by another developer these files will need to be merged. Doing this every time will get old fast. Git has the built in ability to exclude files from source control. Let's take a look at how.

View the Git for SalesLogix Developers series index

The .gitignore file

Git uses a simple text file, named .gitignore, that you can use to enter file names, paths, or file name or path patterns to exclude from your Git repository. These files will still exist on the file system. Git just won't keep track of them and won't include them when you push changes. This way, each developer can have their own file that is independent of what you're working on. This .gitignore file is nothing more than a list of files & paths that are not being tracked by Git and will be ignored. To create a gitignore file all you need to do is create a text file and then place it in the root of your Git repository - in our case it will be the root of your SalesLogix model folder.


What to Exclude from a SalesLogix Model

As I mentioned earlier, there are some files in a SalesLogix model that you don't want to include in the Git repository. These are the main items to exclude:

  • 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.
  • Model\Deployment 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. We'll include this entire folder tree and everything in it.

In addition to those files, there are some files that is good to exclude as well. These are files that can be left behind by file merge & compare tools.

  • *.BACKUP.*
  • *.BASE.*
  • *.LOCAL.*
  • *.REMOTE.*
  • *.orig

If you're using Visual Studio and creating external assemblies for use within your SalesLogix model (if not you should be), then you'll also want to exclude these files and paths as well.

  • *.suo
  • *.cache
  • *.obj
  • *.pdb
  • *.user
  • obj/
  • Debug*/
  • Release*/

Let's see what the .gitignore file looks like with all of that together.


The Complete SalesLogix .gitignore File

This is what the complete .gitignore file would look like for a SalesLogix model:

# Files created from DiffMerge
*.BACKUP.*.xml
*.BASE.*.xml
*.LOCAL.*.xml
*.REMOTE.*.xml
*.orig
 
# Model files that are auto-generated
[Mm]odel[Ii]ndex.xml
 
# Standard Deploy files
[Mm]odel/[Dd]eployment
 
# Visual Studio files
*.suo
*.cache
*.obj
*.pdb
*.user
obj/
[Dd]ebug*/
[Rr]elease*/

You just create a text file, paste that in, and save it as ".gitignore" in the root of your Git repository. You can download this file zipped from me here:

 Download the .gitignore file


When Should You Use a .gitignore File?

Always.

Seriously. Every project should have a .gitignore file. There is always something you want to exclude. Or should exclude. If you don't think you need one then you might not be thinking forward enough to understand how files you're adding will effect merges for other developers. Even if you're just a single developer today, you never know what the future will bring.

Adding the .gitignore file right at the start of the project will save you many headaches later. Once a file is tracked by Git, adding it to the .gitignore won't remove it from Git control. You have to manually remove the file from Git control, then it can ignore it. Also, if you add the .gitignore after other developers have pulled the repository and have made changes, you're really going to screw things up since when they pull, and get your .gitignore file, and they've modified files you've told Git to ignore - clear your afternoon. You'll be practicing your cursing skills. So, always remember, add the .gitignore before you ever do your first commit, and for sure before you do your first push.


Using Git Extensions for SalesLogix

If you're using Git Extensions for SalesLogix, it will automatically create the .gitignore file for you, with the entries I mentioned above. You can read more about that here: Excluding SalesLogix Model Files from Source Control

View the Git for SalesLogix Developers series index

What's This?
  
Bookmark and Share

About Ryan Farley

   Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

View the SalesLogix Mobile Seveloper Series
View the SalesLogix SData Developer Series
View the Git for the SalesLogix Developer series



Related Content
   How do you add a parameter for File Attachment Size and Timeout in Saleslogix 8.1?
Question: Is it possible to set a parameter for file attachment size and timeout in Salelogix? If
Posted on Aug 07, 2014 by Dale Richter to SalesLogix Questions & Answers
 
   Fixing Duplicate Saleslogix FieldIndex Values in the SECTABLEDEFS
I had to fix a client's SECTABLEDEFS table that contained duplicate FieldIndex values.  FieldInd
Posted on Aug 07, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix XBar Installation
When installing the new XBar application I found the instructions a little vague so I thought I would pas
Posted on Jul 18, 2014 by Mark Duthoy to SalesLogix Support
 
   "Saleslogix’s affordable pricing and usability allow the product to rise above competitors in the space" - Info-Tech Research Group, Inc.
"SalesLogix’s affordable pricing and usability allow the product to rise above competitors in the sp
Posted on Jul 14, 2014 by Scott Weber to SalesLogix Product Blog
 
   Saleslogix Default Group Layout
How can I default the formatting of columns in my Saleslogix groups?
Posted on Jul 03, 2014 by Dale Richter to SalesLogix Questions & Answers
 
Comments

 

Twitter Trackbacks for Git for the SalesLogix Developer - Using the .gitignore to Exclude Files in Your Model - Ryan Farley's Blog [customerfx.com] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Git for the SalesLogix Developer - Using the .gitignore to Exclude Files in Your Model - Ryan Farley's Blog         [customerfx.com]        on Topsy.com

September 24, 2010 7:46 AM
 

Kevin said:

I notice you don't have *.delete*or */Deleted Items/* included in the .gitignore.  Should those files be kept under source control?

August 9, 2011 10:53 AM
 

Ryan Farley said:

Hi Kevin,

I like to keep the deleted items in the model. This way, Dev1 can delete items from the model and then push the change. Dev2 can then pull the repo and can bundle up the delete to deliver. Later, the decision might be made to bring back a deleted item which any of the devs can do since they all share the same deleted items.

-Ryan

August 9, 2011 11:10 AM
 

Kevin said:

Makes sense.  Thanks for the quick response!

August 9, 2011 11:16 AM

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register