Git: How to remove file from index without deleting files from any repository

前端 未结 7 1909
情深已故
情深已故 2020-11-30 17:17

When you use

git rm --cached myfile

it doesn\'t delete from the local filesystem, which is the goal. But if you\'ve already versioned and c

7条回答
  •  再見小時候
    2020-11-30 17:37

    After doing the git rm --cached command, try adding myfile to the .gitignore file (create one if it does not exist). This should tell git to ignore myfile.

    The .gitignore file is versioned, so you'll need to commit it and push it to the remote repository.

提交回复
热议问题