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?
As you do your work, Visual Studio keeps track of the file changes to your project in the Changes section of the Git Changes window. When you are ready to stage changes, click the + (plus) button on each file you want to stage, or right-click a file and then select Stage.
Visual Studio maintains a history of file changes. Modified files are marked with a red check mark in the Solution Explorer. You can compare your changes with the original file by right-clicking on the file name and selecting Compare with Unmodified. The Diff window shows new code in green and removed code in red.
Right-click the file in Solution Explorer and select View History. The Visual Studio History view will appear, showing the commits in your repo that updated the file. You can filter the commits to find the exact commit with the file version you want to restore. Double click on the version to open it in Visual Studio.
When you stage a change, Visual Studio creates a Staged Changes section. Only changes in the Staged Changes section are added to the next commit, which you can do by selecting Commit Staged. The equivalent command for this action is git commit -m "Your commit message" .
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With