Adding a locked file to gitignore is not an option for me, because I want it to be a version, but I may not need to commit it often with other minor changes that I make. Even if I temporarily exclude locked files, it still will not allow me to commit unlocked files. It is really very annoying.
What I find for me is using another Git client to commit files outside of VS2015. Also not an ideal solution, but it does the job. The only other solution I found was to close VS, open it again and write files before doing anything.
source share