Adding version control to an existing project

前端 未结 22 1072
天涯浪人
天涯浪人 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: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.

提交回复
热议问题