Tuesday, April 20, 2010

Getting New Code Into SVN From Visual Studio

I'm currently using SVN as source control. I use Visual SVN integrated with Visual studio, which I think is awesome. I used to work at a place that used command-line CVS to control source - yikes. Nothing like crazy long command-line arguments to make source control hard.

But anyway, to the task of adding new code to the repository. I'm sure there's many ways. But here's mine. FYI, when I was setting this up, I was told to install Tortoise SVN and Visual SVN server/client. I'm not sure if that's necessary, but that's what I did and it works.

1) On the PC with the Visual SVN server (could be your local one, or a remote one. I like remote ones in case something happens to your local one), create a new folder in SVN's repository directory.
2) Right-click on that folder, go to tortoise SVN, and select "create repository here." It'll go ahead and do some stuff (add directories, files).
3) Then back in Visual Studio, I right-clicked on the project and clicked "add to subversion." I chose to do this in an existing repository, and selected the one I just created.
4) Then just keep clicking through the dialog boxes until you're done. Don't forget to commit your code after adding, too.

This all assumes you have the SVN repository set up, and you have Visual SVN already setup and integrated with Visual Studio.

No comments:

Post a Comment