0

I am working with Visual Studio 2022RC and Git for version control. I am obligated to use Visual Studio for some projects for a variety of reasons. I have set my Git diff tool and merge tool to be Visual Studio.

Sometimes I find myself with multiple changes to a single file that I would like to break up and explain, or I want to commit a files separately but not without the corresponding change to the Visual Studio project file.

In Visual Studio Code I can open the diff and select lines and 'stage selected range' and then commit with a message. I have not been able to find an equivalent in Visual Studio.

I imagine this must be possible via the Git Bash prompt but this would be inconvenient if there are many changes.

I have looked through the Git options in Visual Studio but cannot see an option that would enable this feature. I also queried the Visual Studio help documentation and followed a few of the top URLs.

Is there a process, or a built-in tool for this purpose, or perhaps a third party extension?

GettingItDone
  • 523
  • 8
  • 26
  • This is on the VS roadmap (though it has been for some time), upvote here: https://developercommunity.visualstudio.com/t/git-stage-selected-portion-of-file/443834 – Jimmy Oct 26 '21 at 18:10
  • I appreciate the pointer, I have voted for the feature. – GettingItDone Oct 26 '21 at 19:37

2 Answers2

1

According to Developer Community is the feature working with Visual Studio 2022 version 17.2

Magnus
  • 83
  • 1
  • 7
1

This has shipped with Visual Studio 17.3.

enter image description here

jessehouwing
  • 106,458
  • 22
  • 256
  • 341