Adding version control to an existing project

前端 未结 22 956
天涯浪人
天涯浪人 2020-12-30 02:52

I am working on a project that has grown to a decent size, and I am the only developer. We currently don\'t use any version control, but I definitely need to start.

相关标签:
22条回答
  • 2020-12-30 03:12

    It may be overkill for what you require but creating a SVN repository on one machine, and then on another setting up an contious integration server. TeamCity is one I would recommend. (you may also be able to use virtual PC for this if hardware is at a premium)

    This will allow you to add the custom build steps to deploy onto the production servers once a build is complete and tested.

    TeamCity for more information. Thi also provides a plugin into Visual Studio as well

    0 讨论(0)
  • 2020-12-30 03:13

    Version control and deployment are two separate issues (although a good version control system can make the deployment a more consistent, reproducible process). Once you have your version control server set up you can use a set of simple script/batch files to automate checking the code out and deploying it to the server.

    0 讨论(0)
  • 2020-12-30 03:14

    To expand a little on the previous answer...

    1) Create a new SVN repository
    2) Commit all the code you've worked on so far to it
    3) Check all that code OUT again, to create a working copy on your dev machine
    4) Work!

    It's definitely not a hurdle, really.

    0 讨论(0)
  • 2020-12-30 03:14

    I have recently started to love the simplicity of Bazaar to solve the problem of starting version control after already having hacked on an application for a while.

    With bazaar it is really only a few simple commands: 1) bzr init 2) bzr add [the files you are interested in] 3) bzr commit

    Note that this does not setup any central repository. But you can do that as well.

    Regarding using it as a deployment tool I am quite sure I read something about it not long ago. The documentation is really good anyway.

    0 讨论(0)
  • 2020-12-30 03:15

    The easy answer is Subversion along with Tortoise SVN.

    I've used Subversion with visual studio, and I've implemented it with an existing project. There is a free Visual Studio plugin called Ankh, which I used with some success. However, I have had some issues where Ankh refuses to stay in sync with the real state of the files as reflected in the .svn metadata (it did things like insist a file needed to be updated when tortoise would show me it was up to date). In these instances, a visual studio restart fixed the issues, but that is painful and tedious for me.

    Currently, I stopped using Ankh and just work my project as normal in VS and then use Tortoise and windows explorer to check them in/out. This works flawlessly. No VS refreshes or restarts necessary.

    0 讨论(0)
  • 2020-12-30 03:17

    +1 for Matt Howell's answer.

    I don't know how many times I've added a new project by creating the directory in the repo, Importing the new project into it, then Checking it out again. This is why Matt's answer is best:

    1. I create a project called FRED and do some work

    2. I create a directory in SVN repo, and import FRED into it.

    3. But the FRED directory is still not under source control - it lacks .svn files, so I need to check it out, into a new directory, let's call it FRED-NEW, recreating all the files

    4. I then need to delete FRED, leaving me nervous something's got lost or corrupted along the way.

    As Matt says, check out a step earlier, while the folder in the SVN repo is still empty:

    1. Create a directory in SVN AND CHECK IT OUT into FRED-NEW.

    2. Copy FRED-NEW/.svn into FRED/

    3. Right-click Add all the files. FRED is now under source control without recreating and deleting.

    Still better:

    1. Create a directory in SVN, and BEFORE adding files to it, check the empty directory out DIRECTLY INTO FRED.

    2. Right-click Add all files.

    Also if you're using CLI and didn't think of this until after committing the new files, see alroc's answer below: --force when checking out into FRED.

    0 讨论(0)
提交回复
热议问题