R
R
RapperOfGods2016-11-20 10:22:33
git
RapperOfGods, 2016-11-20 10:22:33

How to un-ignore a gitignore file?

Hello, I ran into such a problem: once upon a time I added a line to gitigonre that forces all files with some extension to be ignored, and now there is one file with such an extension that should get into the commit, and so, the essence of the question is how correctly to make sure that the desired file with the given extension is included in the commit, and the rest continue to be ignored?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Ukolov, 2016-11-20
@alexey-m-ukolov

Add this file to .gitignore exclusions . You, for sure, need to add it more than once, but track changes.

*.foo
!bar.foo

D
Denis, 2016-11-20
@denis6064

If you are using linux, then delete the required line from gitignore, save the file and write the command in the terminal: git rm -r --cache .
The last dot is needed in the command. After that, enter another command git add --all and git status will show information that the file that was ignored is available for commit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question