.gitignore not ignoring web.config

前端 未结 2 1773
萌比男神i
萌比男神i 2020-12-23 20:42

For my remote repository, I\'m trying to ignore the web.config file of my Umbraco website. The .gitignore is in the root of my website, and the file to ignore, web.config is

相关标签:
2条回答
  • 2020-12-23 21:38

    git will not ignore a file that was already tracked before a rule was added to this file to ignore it. In such a case the file must be un-tracked with git rm --cached <filename>.

    So if you are trying to ignore this file newly, run this: git rm --cached web.config.

    0 讨论(0)
  • 2020-12-23 21:43

    If the only you want to do is to prevent commits of web.config that you are running locally without affecting the one inchecked then run this command (in cmd or ps) under your project folder.

    git update-index --assume-unchanged web.config
    
    0 讨论(0)
提交回复
热议问题