** See below for a slight improvement to this answer. **
My solution has been the following:
- Have the
.git
directory at the same level as thesrc
directory. - Always right-click on
src
instead of the project to Save/Refresh/Deploy. - Delete the warnings on the Problems tab if they come up.
I think I only got the warnings when I was just getting started with the Force.com IDE, and now that I've figured out an overall workflow, I don't get them any more.
Note that with this setup, it's fairly easy to make use of Git in my workflow:
- Make sure all of my changes are committed in Git, choose "Refresh from Server" in the IDE.
- Go back to Git to see if there are any changes (
git diff
) from the Development Org that haven't been logged to Git.- Either revert the changes (to the version in Git) and push those files back to the Org.
- Or commit the changes so they're in the master repository.
- To revert the Development Org to a particular branch, just check it out from Git and choose "Save to Server" for the
src
directory.- Follow that with a "Refresh from Server" and a
git diff
to see if there are changes that can't be pushed (e.g., schema changes).
- Follow that with a "Refresh from Server" and a
I've included applications, classes, documents, layouts, objects, objectTranslations, pages, permissionsets, remoteSiteSettings, tabs, triggers and workflows from our Development Org in our Git repository. About the only thing I haven't been able to track is the contents of the package we're working on (so I don't know when things are added or removed).
Updated Directory Structure
Starting a new project, we've moved the .git folder one level higher, so the Force.com IDE doesn't even see it:
- ProjectFoo/
- .git/
- .gitignore
- IDE/
- .project (Eclipse)
- .settings/ (Eclipse)
- salesforce.schema
- src/
- build_scripts/
- documentation/
- other_junk/
So, we use Git on ProjectFoo/
, but from Force.com IDE we reference ProjectFoo/IDE/
. This allows for keeping other files related to the project, that aren't pushed up to the Salesforce org.