简体   繁体   中英

Git pulls updating Config file instead of ignoring

I have a config file inside my Git project directory (bad i know and changing it) and the file is part of my .gitignore

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
PATH/systemConfig.json

The file is not part of my Visual studio solution and whenever i do a git pull on other computers it overwrites the config file with the same data from my config file on my develop computer.

I've tried using this command but it seems to work half the time

git update-index --assume-unchanged PATH/systemConfig.json

Am i using gitignore incorrectly?

Eventually I will be moving the config files to the users home directory to avoid conflicts on git pulls.

git rm --cached PATH/systemConfig.json is not enough: you have then to add and commit in order to record the deletion of that from from Git content.

Only then others will have their own config file left alone during a pull.

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