How to stop Egit committing additional source folders in Flash Builder
I'm using Flash Builder 4.6 (Eclipse 3.7) and Git (eGit plugin).
My project has some additional source folders configured under "Build Path > Source path". When I run a commit, for some reason eGit sees these external files and wants to add and commit them with paths like:
[source path] fruit/com/company/Apple.as [source path] fruit/com/company/Banana.as
Obviously being outside the project they shouldn't be considered by eGit at all; nevertheless I tried various patterns in my .gitignore to get them ignored, but nothing worked:
fruit [source* [source path] fruit/com/company/Apple.as \[*
Using msysgit, the command git commit -a --dry-run does not attempt to commit these files, so it seems to be an eGit / Flash Builder thing.
How can I get these files ignored?
A first step is to ensure, when you want to ignore a directory, that the path of the directory ignored ends with a / in your .gitignore:
That would ignore fruit directory within the directory of the .gitignore (so make sure to place said .gitignore at the right place)
However, regarding linked folder (which is what fruit is, as the OP Fletch mentions in the comment), .gitignore will not work. Linked folder should be ignored by defaults by EGit: see bug 333338. The patches are written, but not yet integrated into the latest EGit release.
Update: Since EGit 2.3 (February 2013), linked folders are now ignored in Egit.
Here's a solution that we can use until we can install the latest version of EGit in Flash Builder 4.6+ (there is currently a dependency issue). Let's say (as suggested) that you have a linked resource defined in this way:
[source path] fruit/com/company/Banana.as
You could manually add all files and folders located under [source path] fruit to the .gitignore file by using the * or ** wildcards:
Since the ** wildcard matches any level of directories, you would have to be sure that the paths and/or file names are unique and cannot be found elsewhere in the project. But, since you are using a reverse-dns naming convention, this solution might be all you need.