I'm trying to add a static resource file I uploaded to my dev org to a git repository. Every time I tell the IDE to refresh from server it doesn't pull the static resource to my local file system. I looked on my dev org and it shows the static resource has been uploaded. Any suggestions what I'm doing wrong? Also I'm using the force plugin for eclipse on a windows box.
First, you'll need to make sure that Static Resources are in your package.xml. It sounds as if you're using the Eclipse IDE and to add static resources into your Force.com Eclipse project, you'll need to:
- Right-click on the root directory of your project, and navigate down to the Force.com Menu > Add/Remove Metadata Components.
- Choose either the entire Static Resources directory or navigate to the specific one you want.
Alternatively, you can edit the package.xml directly and make sure you have this line of code:
< types > < members >*< /members > < name >StaticResource< /name > < /types >
The problem here as it relates to Github is that while your static resource will be in version control, and you can always revert back to a prior version, you have no indication of how your static resources files are changing over time, since the static resource file itself is in binary code or something unreadable to you as a developer.
One fantastic alternative if you're on a Mac is to install MavensMate for TextMate or Sublime Text 2. MavensMate offers a great feature called Static Resource Bundles that allows for quick packaging and deploy of static resources but more importantly, the full directory of the static resource bundles at the same level in the project directory as your src folder, which can then easily be added into version control in addition to the static resource directory from the src folder. Here is a nice demo of the feature in action: