1

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?

Fletch
  • 4,829
  • 2
  • 41
  • 55
  • What gitignore patterns did you tried? – VonC Dec 01 '11 at 14:26
  • @VonC I've tried: fruit [source* [source path] fruit/com/company/Apple.as \[* ... hmm I'll put it in the question because line breaks don't appear here – Fletch Dec 01 '11 at 15:26

2 Answers2

2

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Ok I tried "fruit/" and "[source path]/fruit/" too but neither worked. I'd like to reiterate that the "fruit" directory IS NOT ACTUALLY INSIDE the project in question. It's in another project linked in by Eclipse. I can't put a .gitignore file inside the other project (where the "fruit" directory actually resides) because that project is itself managed by Git. – Fletch Dec 09 '11 at 09:19
  • @Fletch: "linked folder", right! I must have missed that bit in your original question. I have edited the answer to address that specific element. – VonC Dec 09 '11 at 09:48
1

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.

djip.co
  • 997
  • 10
  • 17
  • The bug I mentioned has been integrated: since Egit 2.3, linked folders are ignored. You don't need those ignore rules. – VonC Jan 29 '14 at 20:31
  • @VonC My installation of Flash Builder 4.7 prevents updating to the latest EGit because of a dependency problem (missing bundle org.eclipse.team.core [3.6.100,4.0.0]) – djip.co Jan 30 '14 at 02:42
  • @VonC Were you able to update EGit within Flash Builder 4.6 or 4.7 ? Since I have a vanilla install and I can't do it, I doubt I'm the only one with this issue. The bug might have been fixed in EGit but if we cannot install it in Flash Builder 4.6+ (Eclipse 3.7) then it's not of much use to us... – djip.co Jan 30 '14 at 14:54
  • I agree. I am not able to test it right now, but +1 to your workaround nonetheless. – VonC Jan 30 '14 at 15:16
  • I modified my answer to reflect the fact that the problem is not in EGit anymore but is related to the fact that EGit cannot be updated in Flash Builder 4.6+ because of a dependency issue. – djip.co Feb 04 '14 at 20:37