Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are gitignore files being automatically created in my project?

Tags:

git

eclipse

egit

I have been trying to manage the local copy of the project I am working on using EGit.

I make a pull once there is a push from the other guys. However, there are files that show that I have uncommitted changes in my local repository, but I haven't made any change. I try to resolve these by manually identifying these changes and discover that they are from gitignore files, which I didn't create myself (the files also show errors occasionally).

Is it possible that the gitignore files are being auto-created? How can I maintain a synced local repo state? I am using Eclipse Kepler.

like image 501
SyCode Avatar asked Jun 22 '14 06:06

SyCode


People also ask

Is the Gitignore file automatically created?

gitignore file will automatically be generated. Of course I mostly have things setup in global gitignore but this does come in handy for specific use cases.

Can a project have multiple Gitignore files?

gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository, and that's what I recommend. However, you can put it in any folder in the repository and you can also have multiple . gitignore files.

Are Gitignore files cloned?

gitignore file. If a file is added, committed and another commit with the . gitignore is created, the file will still be part of the repository and therefore cloned.


1 Answers

It is possible that the settings "Automatically ignore derived resources" triggers the generation/modification of .gitignore.
This is a consequence of bug 297674, adding that feature in EGit 2.3 (Q2 2013).

See the EGit tutorial:

You can also configure Eclipse to automatically ignore derived resources, e.g. class files via the Window → Preferences → Team → Git → Projects → Automatically ignore derived resources .. setting.

like image 145
VonC Avatar answered Sep 22 '22 08:09

VonC