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. 我已將*log
添加到個人.gitignore
,如今我想從個人存儲庫中刪除日誌文件。 git
git rm mylogfile.log
will remove a file from the repository, but will also remove it from the local file system. 將從存儲庫中刪除文件,但也將從本地文件系統中刪除它。 this
How can I remove this file from the repo without deleting my local copy of the file? 如何在不刪除文件本地副本的狀況下從存儲庫中刪除此文件? spa