Using Visual Studio 2015, how to commit only one file?

What I've tried: I don't recall to have an issue when in VS2013. When in VS2015, I've tried the context menu inside one code file or right clicking just that file from Solution Explorer, yet it includes all changed files.

I've also tried filtering and that doesn't help narrow down the checkin.


If you're using Git with Visual Studio 2015, from Team Explorer, right-click on just the file(s) you want to commit and select Stage.

Now you'll have a new section above Changes called Staged Changes that only contain the file(s) you want. Type in your commit message and then select Commit Staged. Everything else will still be untouched under Changes.


OR, or, you can always do this in git bash(windows). Make sure you open git bash in your project folder and type following commands:

$ git add fileToCommit.extension
$ git commit -m "This is my commit message"

Push when you are done:

$ git push