简体   繁体   中英

Why does Git ignore png files and how do I 'un-ignore' them?

So I have a repo where I didn't add anything to ignore .png files but they are ignored anyways.

Why is this happening, and how can I fix it?

If you want to be sure if a file is ignored, and (if it is) by which .gitignore, simply use:

git check-ignore -v -- myfile.png

git check-ignore will display the relevant .gitignore file and the relevant rule.

In order to start tracking previously ignored files or patterns:

  1. First, you need to change your working directory to the repository by typing cd <path> .
  2. Second, you need to specify the files or patterns to track them by typing git add -f <file name>.extension for a specific file or git add -f *.png for all png files.

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