Salesforce Source Control is the tracking of changes to the source (or code) of a solution. Source Control can, and does, apply to more than just your solutions code. We can also use Source Control for things like documents, configuration files, images, html files, etc.  Source Control is also known as Version Control, Revision Control, and sometimes may just be referenced as the “Repository”.

Why is Salesforce Source Control Important?

As mentioned above, Salesforce Source Control allows for the tracking of changes that happen on the source code of our business solution or project, however, that’s just the start. Salesforce Source Control also lets us collaborate with other developers and perform advanced tasks such as managing production fixes while new development is proceeding. Probably one of the most used aspects is rolling back code to a previous version (which can definitely save your bacon when you release a bug by accident!).  We can also see who has made changes and what those changes are, as well as, perform code reviews. By wrapping a process around how we control our source code we gain a lot of functionality and position ourselves for collaboration at an enterprise level. Lastly, Source Control is considered a standard tool on any development team (even if that team is one person)

Types of Source Control

There are many providers to choose from. Some are specific and integrated native into whatever platform you’re working while others are open source an application to use with most development platforms. Here is a list of some of the more popular

  • Git –  virtually a standard in terms of repositories. It’s fast and functions extremely well in a collaborative environment. Created by Linus Torvalds in 2005, who was also the principal developer for the Linux kernel.
  • Mercurial – scalable, decentralized, and fully distributed for collaboration.
  • SVN – Apache Subversion successor to Concurrent Versions System (CVS).
  • Perforce – centralized and distributed workflows with enterprise-grade scalability
  • TFS – Team Foundation Server is a Microsoft product integrated into the Microsoft

Many of the Salesforce Source Control options above require a centralized host to push, pull, and collaborate against. For instance, if you select Git then the main remote repository would either need to be on a company server (accessible to your development team) or an online server. Fortunately, there are companies such as BitBucket and GitHub that provide these services. On top of that, there are a ton of user interfaces to provide a friendly experience to the repository.

Source Control and the Salesforce Platform

Salesforce allows a lot of declarative configuration and this creates a unique challenge when it comes to using Source Control.  Declarative meaning all the changes and processes that we can put in place “Using Clicks”. This includes everything from Workflow, Formulas, Page Layouts, Profiles, RecordTypes, and a hundred other things. On top of that, the declarative work could be done by individuals not overly concerned with any sort of process wrapped around tracking these changes. When building business solutions in other languages – the solution is the Source Code but with Salesforce the solution is this complex blend of declarative and programmatic work which exists as the Salesforce Organization itself.

Fortunately, the main development environments (Eclipse and SublimeText with MavensMate) support virtually all the metadata types, this allows you to pull all that declarative work and get it into Source Control. If you still want more information, I would recommend checking out this Trailhead.

Selecting and using a Source Control system for your development needs can be difficult. Hopefully, this article has provided the groundwork for making an educated decision. If you would like help setting up and establishing a Source Control, please feel free to contact us at www.cirriussolutions.com/contact.