The previous post we had discussed removes multiple files from a Git repository and which has been deleted already. Now, if you want to remove a specific file from a Git use below commands,
git rm : Remove files from the working tree and from the index.
$ git rm thelinuxfaq.txt
$ git commit -m "remove thelinuxfaq.txt"
Would you like to remove the file only from the Git repository but do not want to remove it from the filesystem,
use the below command,
$ git rm --cached thelinuxfaq.txt
Comments (0)