Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

We're using Git to manage our project, since multiple developers are working with it and we want to have a revision history.

We're also using the Force.com IDE for development.

I'm now seeing "File only saved locally, not to server" warnings in the Problems tab for each file in the .git subdirectory, which exists at the same level as the src subdirectory.

I'm surprised that the IDE is trying to push those files up to the Salesforce server. Is there any way to configure the IDE to ignore that directory? Is this a bug in one of the Salesforce plugins (they should only try to sync the src directory, or should ignore all directories starting with .)?

share|improve this question
add comment

5 Answers

Well, I haven't really gotten a git + eclipse process "working" but I have at least gotten it to stop complaining about .git files, like so:

  1. Right click the project name and open "Properties" or "Force.com"->"Project Properties" (depends on whether you're seeing it in "Package" or "Navigator")
  2. Expand the "Resource" part of the tree
  3. select "Resource Filters"
  4. Click "Add..."
  5. add a filter to "Exclude all" "Folders" and "All Children", where Name matches ".git".
share|improve this answer
    
Thanks! This worked also for me. No warnings about git blobs anymore! :-) –  Andree Wille Sep 21 '12 at 15:48
1  
Use jejese answer, but don't forget to delete the errors & warnings from the Problems window. They won't go away on their own once you define the files/folders to exclude. They won't come back though either. –  Ryan Shillington Jan 2 '13 at 21:58
add comment
up vote 2 down vote accepted

** See below for a slight improvement to this answer. **

My solution has been the following:

  • Have the .git directory at the same level as the src 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).

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.

share|improve this answer
    
This seems really complicated. Is this making your development cycle take a lot longer? I'm thinking about moving to Git since I've used it in the past and like it, but am also considering SVN and wondering if it would be easier. –  paul Sep 21 '12 at 16:52
    
Doesn't seem very complicated once you start doing it -- it just looks complicated when written out :-). I don't see any advantage to using SVN over Git for version control. –  tomlogic Oct 1 '12 at 18:07
add comment

What OS are you on? In order to avoid issues with the project meta-data files the IDE creates, I usually create a GIT repo inside of the src directory. The IDE may initially issue warnings about saving these files to the server, but you can just ignore them (delete them from the 'Problems' tab listing and they should go away).

The only files that are saved to the server are those referenced in the package.xml files.

share|improve this answer
1  
I've found that keeping .git one level up from src works better, because I can then right-click on src and choose "Force.com->Save to Server" and not get the warnings. Deleting the initial warnings has kept them at bay, for now. –  tomlogic Aug 30 '12 at 22:43
add comment

I used both SVN/GIT with salesforce projects. Both trouble force.com IDE a lot for the same issues you mentioned. We usually keep the repository checkout separate from the force.com IDE checkout. Developers at most work on 4-5 files at a time so they can copy it manually from IDE checkout to the GIT repository checkout.

With git, if developers just copy the src folder back to the repository it will work as well. As git doesn't creates nested .svn folders in each directory.

share|improve this answer
add comment

You can have Git Repository totally in different folder than current Salesforce working directory.

I am using Git successfully in almost all projects. I have also written a small article at - http://shivasoft.in/blog/salesforce/salesforce-git-eclipse-egit-better-and-distributed-source-control/

Let me know if you need more information on using Git with force.com IDE.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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