Git Issues

Hello!

This might be a rather noob question. I am working on a project and cant seem to work out what ".gitignore" file is preventing me from adding certain files/folders.

I have looked in all parent directories of the files in question, none of the ".gitignore" files mention either that directory or the contents of that directory. I tried adding a "!" entry like this to the root ignore file;

!storage/app/formations/

But that didn't seem to work.

Is there a way to have git reload the ignore files? I hate to add the --force flag whenever I need to commit a change to those files.

Thanks in advance!

--EDIT--
I figured it out. There is a check-ignore verbose option that tells you what ignore file and line number the file is being ignored from. Helped me out loads. If others have the same issue check this out:
https://git-scm.com/docs/git-check-ignore

1 Like

You could also reset the status with "Git RESET HEAD . But you figured it out already ;)

That's not quite what I was trying to do. I was not trying to undo or unstage any files, I was simply trying to figure out what ignore file was preventing me from adding a few files.

Thanks for the suggestion though!