My solution is to created the folder and add a ".gitignore" file in there. In order to ignore everything in that folder (apart from itself), the .gitignore file has the following contents:
# Ignore everything in here apart from the .gitignore file
*
!.gitignore
The only other thing I need to do is ensure that my ant build script does not delete the .gitignore file everytime I do a build and clean the "dist" folder. So I add this "exclude" code to my build.xml script:
<delete>
<fileset dir="${dist.dir}">
<exclude name=".gitignore" />
<include name="**/*.*"/>
</fileset>
</delete>
In hindsight, I probably should have gotten the build script to create the "dist" folder. Nevermind, but it was fun trying to find a solution!
1 comment:
I faced this problem when trying to use git as a backup tool with support for deduplication and compression.
My solution was to create my own system. It's available on http://github.com/meingbg/store
But again, that's for keeping files, not code.
Post a Comment