Is it possible to see what your changed in Visual Studio before you commit/push it to TFS? (Gui of Git Diff)

53,329

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.

enter image description here

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:

enter image description here

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:

enter image description here

The Git Diff Margin plugin provides additional information on local changes in the gutter of your source file:

enter image description here

And the Visual Studio 2013 ultimate feature "CodeLens" shows previous commits in the UI as well at the class and method level:

enter image description here

See also:

Share:
53,329

Related videos on Youtube

Frank Visaggio
Author by

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, 2020

Comments

  • Frank Visaggio
    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?

  • Frank Visaggio
    Frank Visaggio about 9 years
    awesome answer! The screenshots were very helpful. Thanks a lot
  • Sasuke Uchiha
    Sasuke Uchiha almost 4 years
    Ok. 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
    Sasuke Uchiha almost 4 years
    There is only a feature to check the changes for a specific file.
  • jessehouwing
    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
    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 select Changes. 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
    jessehouwing almost 4 years
    If 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
    jessehouwing almost 4 years
    Could you delete your old comments now that this is cleared up? It's fortunately not as bad as it first looked :).