Platform: Windows 8.1
To simplify Emacs configuration, I upload my Emacs personal folder C:\Users\username\AppData\Roaming\.emacs.d to github.
Usually I use Emacs 24.3 to edit the init.el file, after which a copy named init.el~ is created under the same folder. With the help of .gitignore I add a line *~ to git clean -fdx the trailing slash file.
The problem is the elpa package like AucTeX which owns a self-contained .gitignore file. This file might contain pattern to remove *.elc file that I want to retain. So there are several .gitignore files under my repository. One is created by my self. The others are for elpa packages.
If I try to git clean -fdx, the AucTeX's .gitignore file will come into effect by removing the *.elc file under the repository.
How can I disable the .gitignore file that is not created by me?
How to deactivate the .gitignore files attached other Emacs elpa packages?
I think you may be confused about the git clean arguments? The
-xargument tells git clean to pay no attention to the contents of.gitignorefiles (so that all untracked files are removed). The.elcfiles aren't being removed because they're listed in the AucTeX's .gitignore file; they're being removed because they're untracked files, and because you've told git not to treat .gitignored files as protected.If you commit the
.elcfiles (which are portable), git won't want to clean them.Personally, I always do that. I don't want to be running with uncompiled code, and I don't want the bother of recompiling everything unnecessarily. The chances of encountering a portability problem are very slim -- and if you ever did run into problems and wanted to recompile a library, it's much simpler to do if there are existing
.elcfiles to tell Emacs which files should be compiled.Add https://github.com/tarsius/auto-compile into the mix, and your
.elcfiles will always be present and up-to-date.If you don't want to do that, then I guess you'll either need to run git clean without the
-xargument and deal with the file patterns from your root-level .gitignore in an additional pass; or else use the--dry-runargument to show what it would delete, and filter out the files you want to actually keep (in which case you might do a first pass without-xand then a second pass with-X(upper-case) which you would filter).