Is it possible to see what your changed in Visual Studio before you commit/push it to TFS? (Gui of Git Diff)
Visual Studio 2013 has a built-in Git version control client. You'll find it on the "Team Explorer", at the bottom of the list of TFS projects. If you already have a local Git repository, simply add it using the add option. If you have access to a remote repository, but have not yet cloned it locally, you can clone it using the, you guessed it, clone option.
It should not be needed, but you may have to tell Visual Studio to turn on the "Visual Studio Git" provider or the "Team Foundation Server" provider. If you have other source control providers installed, like SourceSafe or SubVersion, they may hide this feature. To switch the source control provider, look under: Tools - Options - Source control - Plug-in Selection:
Visual Studio 2013 (as well as 2012) only support the http
and https
protocol to interact with a remote repository. ssh:
and git:
are not supported.
In the solution Explorer you can compare your current version to Unmodified:
The Git Diff Margin plugin provides additional information on local changes in the gutter of your source file:
And the Visual Studio 2013 ultimate feature "CodeLens" shows previous commits in the UI as well at the class and method level:
See also:
- How to Connect Visual Studio 2012 with git (github)?
- What are the big differences between TFS and Git for source control when using Visual Studio 2013?
- Microsoft ALM Ranger Version Control Guidance - Git for TFVC users
Related videos on Youtube
Frank Visaggio
Sr. Staff Engineer, Human Factors + User Experience Design. Formerly Software Developer / Cloud Architect with a passion for Human-Computer Interaction.
Updated on March 19, 2020Comments
-
Frank Visaggio about 4 years
Using TFS-2013 with a project that is using git, is it possible to see the changes I made in Visual Studio 2013 Pro before I commit them? If so how?
Ie lets say I have /project
and i change line 32 of /project /foo.js
Is there a way It will show me what i changed on that line
In short I guess is there a visual way to do a Git Diff in visual studio I could just use Meld like i do on linux but there must be a good way to do this without leaving VS.
Microsoft Tools for Git looks awesome but its only for VS2012. Is there a main repo where I can find a similar plugin for 2013?
-
SLaks about 9 yearsVS2013 has a git provider built in.
-
jonrsharpe about 9 yearsPer the docs you just linked to: "Note: Visual Studio 2013 includes Git tools by default so these tools are not needed. Learn more on MSDN: msdn.microsoft.com/en-us/library/vstudio/hh850437.aspx ".
-
jessehouwing about 9 years
-
jessehouwing about 9 years
-
-
Frank Visaggio about 9 yearsawesome answer! The screenshots were very helpful. Thanks a lot
-
Sasuke Uchiha almost 4 yearsOk. So, basically the Git extension for the VS Studio is useless and I still need the client app for git managing. That is mainly because there is no way to see all the changes which will be committed, which is the most important feature. Do I right?
-
Sasuke Uchiha almost 4 yearsThere is only a feature to check the changes for a specific file.
-
jessehouwing almost 4 years@SasukeUchiha The Changes tab shows all files that have changes and whether they are staged or not. From the Branches & History panel you can compare different states of he history. But that was not the scope of the original question. The Git Client is pretty fully featured ever since Visual Studio 2015.This question stems from the Git integration back in Visual Studio 2013. A lot has happened since then.
-
Sasuke Uchiha almost 4 years@jessehouwing, oh. Thank you a lot. I see it now. For those who are stuck as I am: go to
View
-Team Explorer
- click on the header of the window and selectChanges
. It was a crazy idea for the VS devs to put the menu there. Omg, I was so stuck looking for the menu that I even had to install the Github client instead. :D -
jessehouwing almost 4 yearsIf you're coming from the Microsoft TFS ecosystem, where many folks came from, it's the most sensible place to start looking. Visual studio 2019 Preview now actually ships with a new Git experience: devblogs.microsoft.com/visualstudio/…
-
jessehouwing almost 4 yearsCould you delete your old comments now that this is cleared up? It's fortunately not as bad as it first looked :).