A
A
Alexander2019-02-07 11:16:21
git
Alexander, 2019-02-07 11:16:21

How to exclude the root .gitignore file from a git repository if it's already in the git index?

How to exclude the root .gitignore file from a git repository if it's already in the git index? (required for specific project needs)
Simply writing .git/info/exclude .gitignore in the file does not help.
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Deyashkin, 2019-02-14
@Lobotomist

Just like any other file:git rm .gitignore
This is because the ignore only applies to files not yet tracked. This applies to any file, not just .gitignore. Therefore, adding it to ignore after the fact does not work.
In general, perhaps we have an xy problem here . So maybe you should describe what you want to remove .gitignore for.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question