I seem to have ballsed up my git repo by tracking a file, later ignoring it and then deleting it. The thing is, I want the file to be present in a remote repository (the live site), but just don’t want to track.
Now my master branch is trying to remove all the files from the repository, which I know will delete them on the remote branch when I push changes… I just want to untrack them, but cannot do that as they’re already deleted on master and git rm -r –cached says ‘did not match any files’.
How can I untrack these deleted files without removing them from the remote repository?
You just don’t want to track a file, but you want to keep the file in the remote repository (non-bare).
Use this git command. After you do this, git stops checking the file for possible modifications.
At any time, you can track again by setting –no-assume-unchaged flag
These command do not affect the remote repository.
For more information: http://kar-git.blogspot.in/2012/11/how-to-set-git-to-ignore-few-files-like.html