Search code examples
gitvisual-studiogithubvisual-studio-2017

Commit a single file in Visual Studio Professional 2017


I'm working with an application that is stored on Github. I'd like to commit a single file. It seems like this would be trivial but I don't see how it's done.

If I right click on the file I want to commit and select the Commit command, it seems to show that all modified files will be checked in. There is a Commit All button/dropdown that becomes enabled when I start entering a commit message. But the dropdown has no option to commit less than everything.

enter image description here

Surely this is supported.


Solution

  • If you don't want to commit all changed files, you will need to stage the file(s) you want to commit by right-clicking the file under your list of changes and clicking Stage. After you stage some files, the button that says Commit All will change to read Commit Staged.