10

Do you use Git with Salesforce? What are the key challenges that you have encountered in using Git for Salesforce? We are about to make a decision on Git, and would like to learn from this community.

  • Git is not made for Salesforce, and I am sure that it is not a hand in glove fit. What are the key challenges in using Git for Salesforce? – Kevin Bellati Feb 10 '15 at 22:47
12

The two answers @Jagular referenced are good and @JonathanHersh is right about git just being a tool. Most of what I'm saying below isn't git specific, though. The same could be said about SVN, CVS, etc.

Here are some pain points, assuming a setup where each dev has their own org (e.g. developer edition). They can be dealt with, but are good to be aware of if you are using git + SFDC for the first time.

Need to have a decent understanding of the metadata XML files

In the end you are storing and merging a bunch of metadata XML files in git, so you need to understand them and which ones change when and how. Some of this can be mitigated a little by using something like MavensMate or the Force.com IDE which can manually build your package XML and take care of subscriptions.

Profiles

@Greenstork points out in his answers and others do as well that your developer work flow should not include refreshing from the server. This is generally correct, but if you are doing a decent amount of work on things through the normal SFDC UI, and you have a bunch of profiles in git, you either need to know all of the different pieces of the .profile XML to edit across all of your profiles, or you refresh. If you have devs on different instances, and in some cases the same instance (there can be dependencies on when org was created), they could have different features available. For example, an older org has Manage Self-Service permissions, a new one does not. Additionally, a .profile XML file is updated to only have contents that have to do with whatever was included in the refresh, so you better make sure that your package.xml (i.e., subscriptions) are accurate.

Some things can't be versioned

There are some things that can't be retrieved via the metadata API and therefore can not be part of your version control. You need to maintain those changes separately somehow (list in git, google doc, wiki, etc.). This isn't a git problem, per se.

Changes made in production

Admins can make changes in production the second after you deploy. How will you handle getting those changes back into git? Will you? If you don't do any dev work for a while do you start by trying to get all of those production changes in to git? It's easy to say that admins have to follow your process and use git, it's another thing for that to happen.

Deletes

If you delete something in your branch and check it in, it removes it from git and the next dev has it removed from their branch; however, it is not actually removed from their org. A separate destructive change is needed.

Branch Switching

When you switch branches and you are using the same org, your org doesn't change to be exactly what is in your branch even after you apply the changes in the branch. If you have other changes in your org they won't be deleted. Carefully consider when you need a new org vs. using an existing org.

All of that being said, I use git with git-flow with a team where every dev has their own org, continuous integration, and automated builds and it works really well. I couldn't imagine going back to a shared org for everyone on the team.

  • Hi Peter, thats a nice explanation. do u hv any blog post on ur git flow setup, jus eager to know/understand how its been setup and working in ur team. – Vamsi Krishna Feb 11 '15 at 0:43
  • Sorry I do not have anything blogged about it. That's a good idea, though. – Peter Knolle Feb 11 '15 at 1:27
8

The accepted answer for this question discusses using Git with multiple developers:

How to use GIT on multi dev environment

The accepted answer for this question talks about managing Git with Sublime

Managing Git with Sublime Text Salesforce IDE plugin (HaoIDE)

2

I am using GIT with Salesforce which automatically take daily backup of metadata of nearly 6-7 environments. You can check here :

http://www.jitendrazaa.com/blog/salesforce/salesforce-git-eclipse-egit-better-and-distributed-source-control/

http://www.jitendrazaa.com/blog/salesforce/salesforce-git-eclipse-egit-better-and-distributed-source-control/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.