Adding an existing folder to SVN outside of visual studio - visual-studio

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!

Related

Migrating from webstorm to Visual Studio 2015 - importing files from subversion using ankhsvn

I have been using the Webstorm trial version for a month and it has expired, so now I am considering using Visual Studio.
However, I have come across a stumbling block using ankhsvn, which is that I cannot figure out how to "import" files from existing files in subversion and add them to a project. Add to Subversion simply adds a new folder to the repo and I cannot see the existing files in the project explorer.
Is there a newbie friendly tutorial on how to import files from an existing svn repo to a solution in local space?
D'oh! Turns out I just needed to use Tortoise to check out the files, then create a blank solution in the same folder as the check out (this is important or ankhsvn won't play nice), and then add existing website to the project.

How do I put an existing Visual Studio solution under source control using VisualSVN Server?

I have an existing Visual Studio 2013 solution, and I want to put it under source control using VisualSVN Server. I installed VisualSVN Server and created a new blank repository. Their Getting Started page doesn't explain how to add a folder structure and files to the repository. I am expecting an import or add files option when right clicking on the repository node in the UI.
How do I add an exiting root folder and all its files and folders of a Visual Studio solution to a repository and make it ready so any SVN client can check out files from it? I am planning to use TortoiseSVN as the client.
You need to install TortoiseSVN and check out a working copy of the repository. Copy from solution into the working copy, select all files, and make a rightclick and select TortoiseSVN -> Add.
Commit the changes and now you have the data added to the repository.

Visual Studio: How to create project from existing GitHub repository?

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.

All project Files get read only attribute after download from TFS 2010

I am using Team Foundation Server with VS 2010. I am facing a problem that when i am mapping a new folder to download the code from TFS, after download all the code, all files/folder in new folder get automatically read only attribute and i have to remove this attribute explicitly after it i am able to build the solution other wise it is giving me "Access denied" error. Is there any TFS setting which is making my project files as read only.
Not with TFS 2010, this is called "Local Workspaces" and is available from TFS 2012 onwards and works like Subversion.
What you are doing, by removing the Read Only flag, is fighting TFS. What you should do is perform a Checkout on the file before editing. If you are using Visual Studio to edit solutions/projects this will happen automatically providing you have your Solution and Project bindings setup. If you are editing files outside of Visual Studio, you can perform a checkout by:
Using Source Control Explorer in Visual Studio.
Using the Team Foundation Server Power Toys to install a Shell Extension into Windows so you can Right click.
Opening the file in Visual Studio and using it as a text editor.
Using the tf checkout command line.
By removing the read only flag, you are allowing yourself to edit the file, but not instructing TFS that you have changed it, so TFS won't know to check it in when the time comes. TFS doesn't scan you workspace for changes like Subversion.

Team Foundation Server- How to effectively set up source code layout with dependencies

I am currently trying to set up a new visual studio 2008 solution while using TFS.
Current structure is as follows
ProjectName
- src
* SomeSolution.sln
* ProjectFolder1
* ProjectFolder2
- Third Party Tools
In subversion I would just go to the root directory and do svn update. Or with Git, git pull origin from the root directory as well.
When in Visual Studio and I right click the solution and press "get latest version" I only get the latest src located in the solution. Is there a way withing Visual Studio where I could cleanly get the latest libraries as well? Or am I going to have to install the powertools on every developers machines so that they can update from windows explorer?
Using the Source Control window, right click on the ProjectName and select Get Latest Version
Or, add the Third Party files under a solution folder. That way you can continue using the file/directory structure you have set up, as well as be able to get latest just from getting latest on the solution file itself
As qntmfred said, Run Get Latest from the Source Control window. This is the only way to ensure that you get everything in the source tree you want.
We typically have an Assemblies folder in our main solution that all third party binaries used in that application are branched into. When the third part library is updated, we sync the branches with the relevant solutions that need them. All projects reference the assemblies from their locally branched copies. For example:
$TFS/
/ProjectName
SomeSolution.sln
/Assemblies
/Third Party (contains DLLs only)
/Websites
/ProjectFolder1
/ProjectFolder2
/Third Party Tools
/(tool name)
/bin
/src
You must install the TeamExplorer on all machines that access the TFS server. Just know this way. The "GetLastVersion" already overwrites files of the machine.

Resources