Is there a way to quickly do a diff the file currently being edited in
Visual Studio against its version in master? The best I've been able
to find is to do Git > Commit, and find the file in the list of
working dir changes.
Since you tagged your question with "git extensions" I'll go ahead and assume that you've installed Git Extensions. =)
Having installed Git Extensions you should in Visual Studio now have a new toolbar provided by Git Extensions.
What you also now have available are some new options in a series of context menus. Right click anywhere in a file you're working with in Visual Studio and select "Git: Diff". This will open your diff tool of choice showing you the changes in your working copy compared to the latest known commit in the branch your working in.
Use the git source control provider extension
http://visualstudiogallery.msdn.microsoft.com/63a7e40d-4d71-4fbb-a23b-d262124b8f4c/
Related
Visual Studio 2019
TSVN 4.8.53
(tried also with VisualSVN 7.2.0 )
TortoiseSVN installed with command line tools
I want to see in Pending changes from TSVN only the changes for current solution. Instead I see all the changes from the entire checkout folder.
In Options => Windows= > Options, at "working copy root path" it is put the path of the checkout folder.
I remembered I used this extension successfully with VS2017
Do you any idea what could be?
UPDATED (26.11.2019)
It seems I cannot make TSVN or VisualSVN to work in an elegant way. I can set the working copy on each project to point to my solution folder, but:
1. I have more than 300 projects.
2. It modifies the source files
I tried to contact the support from both extension but still no answer
you can find the setting in Extensions>VisualSVN>Set working copy root. Uncheck "determine working copy automatically":
I don't want VS to fiddle with git, I use sourcetree for that, so I set the source control provider in the tools -> options -> source control to none.
As soon as you open a project that has git versioning on it the setting automatically switches back to git source control provider.
How to permanantly disable it?
I'm using visual studio 2013 update 5.
I found that I had this problem, even for projects that have never had anything to do with git. It started when I initialized a git repo in my C:\Users\<username> directory, and it went away wen I deleted the .git\ folder from that repo.
Just found an answer in a blog:
http://researchaholic.com/2015/02/02/remove-the-microsoft-gitprovider-from-visual-studio-2013/
To remove the git provider altogether one can delete the key
11b8e6d7-c08b-4385-b321-321078cdd1f8
from the registry via regedit:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\SourceControlProviders
note that you completely remove it, so only for people not interested in a CPU eating annoying ms-plugin.
I also found it does this, if you keep all of your source code in one base folder (in my case D:\Source). I have my TFS "root" mapped to D:\Source<project name>. As it turns out, I downloaded some sample Xamarin project from Microsoft using git & started in the D:\Source\ folder, which created the D:\Source.git folder. After creating this folder, it assumed anything that was a peer/sibling to that folder was a git repo.
Deleting this .git folder in my TFS path fixed it for me.
I came from Eclipse background and I am apparently missing something.
There is an existing GitHub project with JS code in it and I would like to start adding TypeScript nature to it, one type at a time.
I have followed this tutorial to clone project from GitHub to my "local git repository". Now the Team Explorer window displays it as local repository and I can commit changes etc but it's not a project and I don't know how to open it as a project (I want to open it as TypeScript project).
The workflow I was used to from Eclipse would simply be New -> Other -> SVN -> Checkout Projects from SVN that is automatically followed by New Project Wizard.
How do I clone existing JS project from GitHub and make it a TypeScrip project while keeping the existing folder structure?
EDIT: I am using Visual Studio Express and I am limited to the native Git extension.
What I typically do in this situation;
Clone repository using Git in Visual Studio; or use GitHub for Windows and Clone in Desktop from the Git project's web page. This will create a directory (repository) with the project files where you specify.
In visual studio, File->New->create a new project from existing code. From the wizard, select C# or C++ (whatever your choice it does not really matter)
The wizard requires a project file location: give the location of the Git folder that contains the project files (where you cloned the project's repository).
The Wizard requires a unique project name, for example you can use the name of the Git project with VisualStudio (or VS) appended to the end.
Git will now be in sync and you will be able to see all the git files. Making changes will check them out and allow you to push them to the project etc...
***** By default Git will want to check in the newly created .csproj file that Visual Studio creates to allow you to open the project in Visual Studio. You will just want to drag this into the excluded changes section because most likely the project in question will not be using Visual Studio.**
I solved this by opening the site as a website. File->Open->Website.
No Project Files/Solution files required. It just opens up the folder in the solution explorer.
To make it a typescript project, just add a tsconfig.json file to the directory.
Do you have any code in that repository yet that you want to open? I'm guessing not in which case you need to create a new VS project (just like you'd create a new Eclipse project and have it in your workspace)
Go to File, New..., Project... and pick the project type that you want. Give the project a name and set the location to be a folder INSIDE the folder that you cloned your Git repo to earlier (i.e. c:\mycode\mygitproject). Also give your solution a name. A "Solution" in Visual Studio is a wrapper for the projects inside it, kinda like the closest thing to a workspace or a working set in Eclipse but not quite the same thing.
Then Visual Studio should then be smart enough to pick up that this is in Git repo and allow you to commit locally as well as push/pull to GitHub etc.
Finally, while I work with the team that created the Visual Studio Tools for Git, I'd still highly recommend that you get hold of a command line should you want to do some more powerful stuff with Git other than simply committing code, push/pulling changes and branching or merging branches. If you are working against GitHub then you might also want to install GitHub for Windows which will bring some Git tools with it or you can install Git for Windows and also install Posh-Git separately. All of these things work together and give you the maximum power of Git but you can pick and choose the tool that works best for you. You'll probably find a workflow of Clone using GitHub for Windows, commit/push/pull/branch/merge in VS and then Posh-Git if you do more advanced stuff or want to hand-tweak settings.
I have created a repository online and I want to add an existing folder to it and make it version controlled. I am using TortoiseSVN.
When using Visual Studio I can just click "Add to Subversion" and it automatically adds the versioning to my project. When I click into the physical folder everything has icons next to it implying it's now versioned. I can then just commit it all either in or out of visual studio.
My problem is, I now have a folder that isn't part of a Visual Studio project that I want versioned. But I can't work out how to do it. If I click import I can import all the files but it doesn't add the versioning to the folder. I can then export it else where, but still I don't have the versioning.
What do I have to do to make my existing folder versioned without Visual Studio doing it?
You should read the SVNBook and TortoiseSVN manual. At least they'll help you to understand the concept behind Subversion and version-control in general.
When you svn import some folder to Subversion you can later get the working copy of this folder by doing a svn checkout operation in TortoiseSVN or a command-line client.
Whatever tool you are using in Visual Studio is using a subversion client under the hood - you can normally invoke this tool directly from the command line if wanted.
If you are not comfortable with that, you can download and install the free TortoiseSVN tool that integrates with the windows shell. Once installed, you can right click on the files/folders to add them to your repository outside of Visual Studio.
I have just worked out how to do this, so am answering my own question in case someone else is trying to do this:
Create the repository on the server,
svn import everything into it,
svn checkout what you just imported over the top of your existing folder.
Everything now will have ticks by it ready to commit!
How can I view the current revision number of a particular file from Visual Studio or directly from Explorer under SVN Source control? I am using AnkhSVN as the client.
Also, is it possible to know the revision number when the project/solution was last updated from server and changes to some of its files have been made thereafter?
use the string $Rev$ in your source file, e.g.
string revision = "$Rev$".Replace("$", "");
in solution explorer right click on that source file and select Subversion/Subversion properties
Add Property svn:keywords and enable "Rev".
VoilĂ : on every commit "$Rev$" is replaced with the new svn revision.
is it possible to know the revision number when the project/solution was last updated from server and changes to some of its files have been made
Because you have TortoiseSVN installed, check Properties of the root-folder, Subversion tab. "Revision" and "Last commit" are answers
You should install TortoiseSVN to have the integration of SVN in Explorer (File explorer i assume?).
I use AnkhSVN 2.6 and not planning to switch over to anything else.
Found a development library for VS2015 and 2.X
Reference is mensioned on the AnkhSVN website,
https://sharpsvn.open.collab.net/
"SharpSvn is a binding of the Subversion Client API for .Net 2.0-4.0+ applications contained within a set of xcopy-deployable dll's. Notable users of this api are"
short tutorial
https://sharpsvn.open.collab.net/docs/walkthrough.htm
Binaries can be downloaded at
https://sourceforge.net/projects/sharpcvslib/
Gotta try this one day.. for now, I open "Solution History", find the revision number of my Setup project and attach that number to my main version
number manually.