Make an existing folder into a repository

30,516

Solution 1

There is a simple solution for checking in an existing directory structure:

  1. Open the repository browser of TortoiseSVN and create a new directory for the project you want to check-in.
  2. Check-out this newly created empty directory from SVN somewhere
  3. Open the checked-out directory and move the contained hidden .svn directory into the root directory of your project. This enables the context menues from TortoiseSVN for all files and sub-folders.
  4. Add every file and folder you want to check-in (context menu command Add...)
  5. Execute SVN Commit... on the project root folder

Solution 2

An even simpler way than Robert's Answer (although lifting from it):

  1. Open the repository browser of TortoiseSVN and create a new directory for the project you want to check-in.

  2. Check-out this newly created empty directory from SVN as the directory you are wanting to add (ignore the warning about checking out into a non-empty directory).

  3. Execute 'SVN Commit...' on the directory you are wanting to commit, selecting the files you want to add from the commit window.

Solution 3

I would also add a step between 3 and 4:

3.5. Ignore the automatically generated files (context menu command Add to ignore list...)

Share:
30,516
Trinitrotoluene
Author by

Trinitrotoluene

Updated on July 17, 2022

Comments

  • Trinitrotoluene
    Trinitrotoluene almost 2 years

    I've decided that modifying files directly in notepad is probably dangerous and it was about time to have some proper source control (I am quite new to source control). I have installed VisualSVN server on my server and TortoiseSVN on my client machine. I can create new folders fine, check them our etc. However, on my server, I have an existing folder structure in place for IIS and there are links based on this location everywhere. How can I make the entire folder work with SVN without moving the files?

  • kmote
    kmote over 10 years
    Note: Step 1 assumes that your repository structure is set up to have multiple projects in a single repository (i.e., option one in the SVN book). If instead you put each project in separate repositories (i.e. option two), you won't be able to do that from your repository browser. You will need to create the new repository on the svn server itself.