简体   繁体   中英

Git won't pick up changes to certain files

Have a very odd and annoying issue with Git/GitHub.

In a certain branch, any file that has the path as /views/admin/index.php , /views/teacher/index.php , /views/parents/index.php , /views/student/index.php won't detect any changes to the files no matter what. Deleting the file, removing all the code, or just making a small edit isn't picked up at all.

We are using Codeigniter v2.2.0 as the framework, if that is of any use.

This is happening through any folder with a file structure like that.

Have tried multiple different software including the GitHub native app and Sourcetree.

There is another branch we have that works fine.

Tried cloning the branch with the issue but it still has the problems on the new branch.

Any ideas that could help would be great :)

Whenever you have a file which seems to be ignore, you quickly can check that with git check-ignore :

git check-ignore -v -- /path/to/yourFile

That will help list the exact .gitignore referencing that file.

Massive facepalm moment.

I had index.php in the .gitignore, I needed to have /index.php to ignore only the index.php in the main directory.

If your using SourceTree as you mentioned, change the File Status combo from the Working Copy view to "Show Ignored". It doesn't display ignored or untracked in "Show All".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM