Eclipse: how to ignore .git subdir when adding one project to another project build path?

I am developing an application that should work on both Android and regular Java SE.

I have an eclipse project called foobar-core that contains code that is used for both Android and SE version. I have another project called foobar-android that contains all the Android specific codes.

I need to reference some foobar-core code in the foobar-android project , so I added foobar-core to foobar-android in settings -> Java Build path -> Projects -> Required projects in the build path. This works great as I can now use the foobare-core code in foobar-android .

Here's the problem: foobar-core and foobar-android are independent git repositories, which means they both have a .git subdirectory. Now I get a lot of warnings on the Console tab whenever I compile foobar-android . They look like this:

/foobar-core/src/.git/HEAD conflicts with another file already put at .git/HEAD
/foobar-core/src/.git/config conflicts with another file already put at .git/config
/foobar-core/src/.git/description conflicts with another file already put at > .git/description
/foobar-core/src/.git/hooks/applypatch-msg.sample conflicts with another file already > put at .git/hooks/applypatch-msg.sample

How can I tell Eclipse to ignore .git files when importing sources from foobar-core project?

+3
source share
2 answers

Even if you have only one git repository, it is useful to ignore the .git directory, because another Eclipse will spend a lot of time looking at the files in it, even if it never needs to do anything with them. In particular, when you perform a large-scale project search, Eclipse will look for all the files in the .git directory, which takes a lot of time and ends up seeing a lot of duplicates (or almost duplicates, older versions of the same file with one found same search query).

, Eclipse git, , , , , Eclipse, .git- "", , Eclipse .

, " " "", .git. .git, , "" , "".

+2

.gitignore, foobar-code.

+1

Source: https://habr.com/ru/post/1753078/


All Articles