For reasons that do not add anything to this question1, I would like to know whether it is possible to configure git to use gitignore
instead of .gitignore
.
A similar situation is having git
instead of .git
as the git working dir of a repository, which can be easily accomplished by adding the line
gitdir: ./git
to a .git
file living at the root folder of the project. Hence I wonder whether it is possible to tell git not to use .gitignore
but another file to contain the rules for files and folders that need not to be tracked.
There are similar questions suggesting the use of $GIT_DIR/info/exclude
as a solution. Even though this leverages in practice the same mechanisms used by the gitignore file, my question is whether the actual .gitignore
could be assigned to be some other file.
You should be able to change the ignore file by entering the following:
git config core.excludesFile gitignore