Faire un import "sur place" dans SVN

Marqué :

Voici commentr transformer des données originales en un espace de travail.

Disons que vous souhaitez faire du répertoire ~/working/toto le ~/repo/project/trunk de votre dépôt.

cd ~/working/toto
svn checkout file:///~/repo/project/trunk .
svn add *
svn commit -m "Initial import"

Vous souhaitez ajouter le répertoire ~/etc ?

svn mkdir file:///~/repo/project/trunk/etc \
        -m "Make a directory in the repository to correspond to /etc"
cd ~/etc
svn checkout file:///~/repo/project/trunk/etc .
svn add apache samba alsa X11 
svn commit -m "Initial version of my config files"

This takes advantage of a not-immediately-obvious feature of svn checkout: you can check out a directory from the repository directly into an existing directory. Here, we first make a new empty directory in the repository, and then check it out into /etc, transforming /etc into a working copy. Once that is done, you can use normal svn add commands to select files and subtrees to add to the repository.

Voir aussi