Reputation: 6615
New to VS 2019 and trying to split a larger change into several atomic commits. Say I have file.cpp
:
// Line 1
// Line 2
// Line 3
// Line 4
// Line 1a
// Line 2
// Line 3b
// Line 4
When I go to the Team Explorer
tab, I can see that file.cpp
has been changed. But I'd like to make two commits, one for Line 1a
and a separate commit for Line 3b
.
Is this possible in Visual Studio 2019? Or should I use an external tool such as git-gui
?
Upvotes: 1
Views: 1953
Reputation: 880
As far as I know, it is not possible to do via Visual Studio 2019. Visual Studio, does not allow you selecting hunks or specific lines (of code), in a particular file to stage for commit. It always stages the whole file.
Even the documentation does not mention anything about it.
As you've mentioned.
You can use Git-GUI
. Which does exactly what you desire or any other tool.
It can also be done via CLI, if you are in to it.
Upvotes: 2