Reputation: 975
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.
Upvotes: 62
Views: 33752
Reputation: 17929
I have Visual Studio 2019 Community Edition and the tab "Team Explorer" doesn't work for me so @JayAdams' answer is of no use for me. I also don't want to dabble with the command line if I can avoid it, so I found this other way:
Upvotes: 0
Reputation: 2112
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.
Upvotes: 186
Reputation: 71
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
Upvotes: 4
Reputation: 5327
View->Other windows->Pending Changes
Then exclude whichever file you do not want to commit.
Upvotes: -7