To track it, simply delete it and commit, which will remove the database from the latest version of the repository. It is still easy from the Visual Studio interface. If you need to save the sdf, then copy it to a temporary location.
To remove it from git (and save it in place on the file system), you can issue the remove command from the command line . This is not easy to do from the Visual Studio user interface.
git rm --cached yourfile.sdf
To completely remove an unnecessary file from the repository, you need to go to the command line . This will delete the file from your story.
WARNING This will overwrite the history, as a result of which all your commit IDs will be changed. Attention
git filter-branch --prune-empty -dc:\temp\tempfolder --index-filter "git rm --cached -f --ignore-unmatch yourfile.sdf" --tag-name-filter cat -- --all
The file will no longer be referenced and will be deleted from the repo at some point. To tell git to delete the file immediately, follow these steps:
git update-ref -d refs/original/refs/heads/master git reflog expire
Finally, copy these changes to your remote:
git push origin --all --force
This force push requires additional permissions in TFS. by default, only project administrators have this permission .
For more clarification, read related answers to related questions.
If your remote repo has branches that you do not have, you may need to pull all the branches first . You can do this using:
git pull --all