简体   繁体   中英

files from folder excluded in .gitignore appears in commits

my .gitignore file contain /var/ folder:

/.idea
/media/
/var/
/errors/

but files from var/cache/ and /.idea appears regularly on new commits.

Yes, I did git init for entire project at the beginning, but also did git rm -r --cached var/ as suggested in https://stackoverflow.com/a/1330097/6827096 but new files still appears. 在此处输入图片说明

I think it should be, it depends where the gitignore file is. If itś in the same directory as the folders do something like this:

.gitignore
.idea
/media
/var
/errors

or:

 .gitignore
 .idea
 media
 var
 errors

I would post this as a comment but I dont have enough rep for that yet.

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