简体   繁体   中英

Excluding certain files while 'git pull'

I am doing a complex PHP project with two other people. We had git setup for the project from the beginning. After working for two months, we wanted to remove certain folders ( /dev/app ) from git tracking ( git was already tracking them). So I deleted all the files from /dev/app and added a entry in the .gitignore file to exclude the PHP files in the /dev/app folder.

**/dev/app/*.php

I made a commit to the master branch. I pushed them to the origin and it was working fine. But my colleagues were working on different branches. When I merged their branches with the master, git started to track the excluded files again.

In the local environment it is not a problem, but in the production environment it is a huge headache. I only need the client generated files in the /dev/app folder in the production server, and I need to preserve them without any modification.

can anyone help me to overcome the issue?

您应该将这些文件添加到.gitignore

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