char
char

Reputation: 29

how to add files to SVN

im trying to add a word document to my svn repository, however im confused on how to, im doing it through terminal

 A    wc4/code
 A    wc4/code/branches
  A    wc4/code/prototype_demo
 A    wc4/code/tags
 A    wc4/code/trunk
 A    wc4/docs
 A    wc4/docs/0_diaries
 A    wc4/docs/1_plan
A    wc4/docs/2_interim_report

these are the files and i've done "cd wc4/docs/2_interim_report" then "svn mkdir interim" which made another sub file interim

how do i add my word document inside it because when i do

"svn add /desktop/interim report" which is where the file is saved it is giving me error

  W150002: '/Users/char/wc4/docs/2_interim_report/interim' 
  is already under version control
  svn: warning: W155010: 
 '/Users/char/wc4/docs/2_interim_report/report.doc' not found
 svn: E200009: Could not add all targets because some targets don't exist
svn: E200009: Could not add all targets because some targets are already versioned
svn: E200009: Illegal target for the requested operation 

Upvotes: 0

Views: 662

Answers (1)

Stewart
Stewart

Reputation: 5002

You should be able to:

svn add wc4/docs/2_interm_report/interm/report.doc
svn commit wc4/docs

Adding files is fairly simple. If I want to add dir1/file1 to my repository and upload to the server I would:

svn add dir1/file1
svn commit dir1/file1

But what is dir1 doesn't exist already? In that case I'd make the directory (doesn't need to be done in SVN) and then make the file like normal. Then simply:

svn add dir1
svn commit dir1

This will add dir1 and all child directories/files to the svn repository, ready to be committed.


When the output of svn status shows an A before your filename, it means you have "added" that file/directory to your working copy and it is ready to be sent to the server. You need to follow that up with an svn commit to send it to the server.


svn mkdir is mostly useful if you want to create a directory on a repository directly without checking out a working copy first. For example, I'd use svn mkdir http://example.com/svn/repo/trunk to make a directory named trunk in a remote repository before checking it out to add fresh content.

Upvotes: 1

Related Questions