Remove a file from a Git repository without deleting it from the local filesystem

后端 未结 11 2182
陌清茗
陌清茗 2020-11-22 02:25

My initial commit contained some log files. I\'ve added *log to my .gitignore, and now I want to remove the log files from my repository.



        
11条回答
  •  無奈伤痛
    2020-11-22 03:03

    To remove an entire folder from the repo (like Resharper files), do this:

    git rm -r --cached folderName
    

    I had committed some resharper files, and did not want those to persist for other project users.

提交回复
热议问题