Salesforce.com and Subversion

by Patrick Connelly posted on April 29, 2009

Our team has since switch to git. For more information read my article on our git workflow

From what I’ve been able to tell, there is no real version control built into Salesforce.com and this is a problem when pushing from a sandbox instance into a production instance. To fix this problem (at least until Salesforce does something), I think the best option is to use the Force.com plugin and the Subclipse plugin for Eclipse. With both of these in place, it should make version control a reality.

  1. Install Eclipse for your platform (it’s eclipse-platform if you are using Fedora)
  2. Install both the Force.com and Subclipse plugin (eclipse-subclipse)
  3. Add your Force.com project to Eclipse (Howto)
  4. Add your SVN repo to Eclipse. (Howto)
  5. Share your Force.com project (Right-click on Project name → Team → Share Project → SVN → Choose repo)
  6. Then after updating a file in the Force.com project, commit the update to SVN before deploying to the server

Now if you want to use this in another Eclipse instance then, you’ll want to do the first two steps to prepare your Eclipse environment. Then:

  1. Add the existing SVN repo to Eclipse (Howto)
  2. Right click on the Project Force.com → Project Properties and update the username / password

When using this in a collaborative setting, the following workflow should be followed whenever possible.

  1. Team → Update
  2. Make changes to code
  3. Team → Update
  4. Make changes to resolve collisions if needed
  5. Team → Commit
  6. Force.com → Deploy to Server