1

Normally, we put everything on stash. e.g. use Eclipse to fetch all metadata, and upload the whole folder on stash.

However, every time we commit changes, there are a lot of changes to make since many metadata on Salesforce is dynamic. We can configure gitignore to ignore those changes. However, is there a best practice for version control on Salesforce? Say, only need to put classes, pages, and some other things on Stash? Is there an instruction on how to manage the version control? Not in technique's perspective but more on concepts and management?

Thanks.

2
  • What do you mean by ' there are a lot of changes to make since many metadata on Salesforce is dynamic'? What changes are these and why wouldn't you want them in the version control system?
    – Nick C
    Aug 30, 2016 at 8:22
  • Referenced Packages is always different every time I check the git status.
    – Yifei Pei
    Sep 1, 2016 at 1:09

1 Answer 1

2

At first, you should determine why do you need version control for Salesforce project. Do you want to track only code changes, or all metadata changes? Or probably have development setup for team of developers, and deployment through testing and production environments for different parts of project?

So, answer to those questions should determine your project and way of working. Below there are some scenarios:

  1. Just track code changes. In that case, package.xml should to include all Triggers, Classes, Pages, Components and Static Resources (as default when you create project in eclipse) And every time, when some logic has been changed, you commit your work only
  2. Track entire org changes. In that case, package xml should contain all members from 1, and also relevant metadata for project (Custom Objects, Profiles, Page layouts etc). In this case, every single change would not be missed, and can be easily reviewed in the future. On that level, sometimes it would make more sense to avoid using * in package.xml, and define every component explicitly to ensure that nothing is being out of scope.

Personally I think that it is bad practice to put something from force.com source project folder below .gitignore, because it is always possible to configure your project to avoid that.

1
  • I think the second scenario fits us better. Therefore, do you mean that we actually should define clearly which parts should be in the repo before we upload files on it? I am a bit lazy that would prefer to upload everything first...
    – Yifei Pei
    Sep 1, 2016 at 1:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .