When we track a file in git, it can sometimes get cached and remain tracked, even if we add it to our file. This is simply because prevents files from being added to Git's tracking system, but it will not actively remove those that are already tracked. .gitignore .gitignore This can lead to issues when you have something you no longer want to be tracked, but can't seem to remove from your git repository. Fortunately, there is an easy way to fix this. has a built-in function which lets us remove cached or tracked changes. To run it, you can use the following command to remove a specific file, where can be removed with the file you wish to stop tracking: git rm [filename] git rm --cached [filename] Similarly, if an entire directory needs to be removed, use the flag which means , to remove an entire directory and everything within it from tracking: -r recursive git rm -r --cached [directory] After running this command, you can then add amend your commit and push it to your remote: git add . git commit -m "Removed tracked files which shouldn't be tracked" git push : This will not remove files from your local computer, but it will remove the tracking of files from your git repository. NOTE It will also remove files from other developers, computers, or servers upon your next . git pull Be careful with this command! Also Published Here