Adding file to git's stage does nothing and cannot be committed

前端 未结 2 1776
清歌不尽
清歌不尽 2021-02-05 03:32

I have gotten myself into a bizarre situation where in one of my branches a web.config file cannot be added to the stage. The output of

git add path/to/web.confi         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 04:07

    The final solution to this particular problem was to remove both web.config entries from the git cache, commit any changes, and re-add the desired Web.config file back to git.

    git rm --cached path/to/Web.config
    git rm --cached path/to/web.config
    git commit -m "Repair confused cache"
    git add path/to/Web.config
    git commit -m "Add Web.config"
    

提交回复
热议问题