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?

Answers


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:

fruit/

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:

**/com/company/Banana.as

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.


Need Your Help

: [$injector:unpr] Unknown provider in angularjs can't inject factory into controller

angularjs dependency-injection angularjs-injector

I have an unknown provider error and I'm not sure how to solve it. I think my services, controllers are declared properly. I have tried everything but it doesn't work. my photosFactory factory does...

jQuery Datepicker in Twitter Bootstrap 3 Modal

javascript jquery twitter-bootstrap twitter-bootstrap-3 jquery-ui-datepicker

I have been trying quite a few solutions to this problem now but i can't get it to work.