+ Start a Discussion
Justin LargeyJustin Largey 

Best Practices for Version Control Structure and Force.com IDE

Hi,

Are there any best practices when it comes to setting up version control (VC) in conjuction with using the Force.com IDE?

For example, should I make one big project in the Force.com IDE that contains all the meta data on my site and commit that?  Then any new classes or triggers should be a part of this project, and committed to VC?  Would this mean that for every feature I deploy, the entire site would be deployed, instead of just the changes I made?  

I'm curious what everyone else is doing.

Thanks




Best Answer chosen by pcon
pconpcon
I just recently wrote a blog post about this [1].  I would maintian a repository that contains ALL of your code and configuration and then deploy that to your development sandbox.  From your develpment sandbox you can then choose to deploy only parts with changesets or using the IDE to do a full deploy back to your production instance.  While the post talks about git from the command-line, you could use git from within the IDE with one of the extensions for it.

[1] http://blog.deadlypenguin.com/blog/2014/07/21/using-git-with-salesforce-and-distributed-teams/

All Answers

pconpcon
I just recently wrote a blog post about this [1].  I would maintian a repository that contains ALL of your code and configuration and then deploy that to your development sandbox.  From your develpment sandbox you can then choose to deploy only parts with changesets or using the IDE to do a full deploy back to your production instance.  While the post talks about git from the command-line, you could use git from within the IDE with one of the extensions for it.

[1] http://blog.deadlypenguin.com/blog/2014/07/21/using-git-with-salesforce-and-distributed-teams/
This was selected as the best answer
Justin LargeyJustin Largey
Thank you for answering, and for pointing me to your blog.  I have one question though, how do you handle/prevent Adminsitrators from making changes in production?  If they do this, your git repo no longer matches what's in prod.  Do you have some sort of reconciliation process that catches these "minor" changes?
pconpcon
We require that all of our administrators follow the same process.  For the most part it is just pulling down the object they changed and committing it.  It didn't take very long for them to get the hang of it.
Justin LargeyJustin Largey
Just so I understand, an administrator would make their changes in a non-production environment, make a changeset, and push it through to production.  When the changeset is made, they will also run something, like solenopsis, to pull all the metadata from the non-production site and commit the differences to the master.  Is that accurate? Or have a missed something?  

Is solenopsis for Unix only? Does it run in Windows?  I'm guessing I could do the same thing with the Force.com IDE, albeit, I'm sure an administrator would not want to be opening Eclipse.
Justin LargeyJustin Largey
Another question on the approach, are you using the Force.com IDE? If so, seeing that each branch contains all the Metadata for a given site, and the Force.com IDE project will contain all this metadata as well, do you find the time it takes to save changes from the IDE to the Dev environment very slow?

And btw, thanks for your help, really appreciate it.
pconpcon
In our organization, admins make a change in their own sandbox and pull down the information and push it to git.  They do this with Solenopsis.  You could store only code in your repo, but then you'll run into the inconsistancies i mentioned in the blog post that will make it difficult to deal with objects consistantly.  You might find it easier to do some sort of ant script for you admins that pulls down the objects for them and doesn't pull down anything but the "adminy" things.

Solenopsis should work on Windows, but we've not tested it, and there are probably some issue regarding path traversing.

We don't use the IDE at all.  All of our developers use vim + solenopsis for development.
Justin LargeyJustin Largey
Great stuff! Thanks again for your help.
Preeti LalwaniPreeti Lalwani
Alternatively, you can use a solution like flosum (www.flosum.com) and your life will be much better. Nothing to install or maintain.
nazim zmirlinazim zmirli
I have worked with Source Control softwares like VSS, TFS, ClearCase, SVN, etc. but my work has primarily been centered around the typical source control operations like get latest, add new files, etc. I want to have a more in-depth understanding of the basic source control concepts like versioning strategies, concepts of a trunk and branch, merge and fork operations, tags and history views. These should be agnostic to the package that is being used and should discuss about the general concepts and best practices. Can anyone point out a good book or internet resource to learn about these concepts..
see: ShowBox (https://showbox.onl/) Mobdro (https://mobdro.onl/) Vidmate (https://vidmate.onl/)
Tam TTam T
deadlypenguin blog post from pcon was really well written and touched on a lot of good points.

Would this mean that for every feature I deploy, the entire site would be deployed, instead of just the changes I made?  

This tends to be a common mistake that many teams made. I've seen many teams gone through the hassle of trying to pick and choose, cherry pick commits because teams are not comfortable with deploying the entire branch. My recommendation, after working with many teams, is that you should deploy everything from a branch to the targeted environment (ie. master -> production) don't pick and choose. 

Deploy everything from your git repo and deploy it frequently is the only way to catch issues early and give you the confidence that Git is your living source of truth. Not to mention that this is much easier to automate than pick and choose. And automation is key in source control and CI/CD.

Here is another blog I wrote with everything I learnt after working with many Salesforce devops teams. 
https://medium.com/@clickdeploy_team/salesforce-release-management-best-practices-4255ad7c7f63

definitely share a few common best practices with http://blog.deadlypenguin.com/blog/2014/07/21/using-git-with-salesforce-and-distributed-teams/

Hope you'll find something useful in it.
ADESANMI FranklynADESANMI Franklyn
They are so many things to learn. For a start check out here (https://vidmatedownloadl.com), here (https://tutuapp.pro), here (https://showboxtvapp.com), and here (https://mobdroforandroid.com). Meanwhile, Facebook (https://pnamecomfacebokorca.com)features are really overwhelming recently. And other apps are following in upgrading. Apps like Vidmate (https://vidmatedownloadl.com), Showbox (https://showboxtvapp.com), and others.
poke sniperpoke sniper
we are still learning more on advancement of technology.
poke sniperpoke sniper
I still think learning from https://www.trytutuapp.com will widen the scope of iOS advancement, even after the rumor on showbox (https://www.movieboxstreamingtv.com) and moviebox (https://www.movieboxstreamingtv.com). Advancement can still be recorded in alarge scale for pokemon go (https://www.trytutuapp.com), tutuapp (https://www.trytutuapp.com) and pokesniper (https://www.trytutuapp.com) and also https://www.movieboxstreamingtv.com
mohsin majeedmohsin majeed