質問

This has driven me insane in the past. I'm more or less over it now, in so far as I've figured out how to import the files, delete them (a true leap of faith - the more cautious among us may prefer to move them), and then check out from the repository to the same place. But I'm still baffled as to why I have to do this every time I decide to put a project under version control.

From http://svnbook.red-bean.com/en/1.7/svn.tour.importing.html

Note that after the import is finished, the original local directory is not converted into a working copy. To begin working on that data in a versioned fashion, you still need to create a fresh working copy of that tree.

... Why? Every time I've ever used the Import command it's been from a local directory which was, up to that point, my personal 'working copy'. Is that unusual?

役に立ちましたか?

解決

I totally aggree on that, however this was a design decision: SVN tried to keep a clean concept in its initial design.

  • Import moves data into repository
  • Checkout creates a working copy
  • Update updates a working copy
  • Commit send changes from working copy to repository

These 4 basic operations are strictly separated by information flow: From repository or To repository

I ran into exact this difficulty on several trainings, therefore I developed a different approach: I never use import, i alway check out the empty (parent-)folder and copy all stuff into the working copy. This also let me preview the result by examining svn status before committing and it means for training attendees 1 commando less to remember.

If you are experienecd enough, you could also checkout the empty folder directly into your to-be-imported directory and add all files afterwards. SVN does not like to check out into a prefilled directory, but you can use --force to persuade svn to try it.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top