feiroox
feiroox

Reputation: 3199

How to commit changes after SVN import?

I've created a project, and used svn import. Now I'd like to commit a change to files, how to do that?

I have empty ~/.workspace/project/.svn/entries.

If I try svn commit I get this:

$ svn commit src/dat/Win.java
svn: '/home/st/.workspace/dat/src/dat' is not a working copy
svn: Can't open file '/home/st/.workspace/dat/src/dat/.svn/entries': No such file or 

directory

… or just svn commit:

$ svn commit
svn: Can't read file '/home/st/.workspace/dat/.svn/entries': End of file found

Upvotes: 8

Views: 37205

Answers (6)

Matti Lyra
Matti Lyra

Reputation: 13078

svn import commit an unversioned file to a repository (on a remote host presumably). After you've done this you need to checkout the repository to you own machine as working copy using

svn checkout http://some.repository.net/trunk/ /my/local/path/to/workingcopy

which will checkout trunk from the repo to your machine to folder /my/local/path/to/workingcopy. Make changed and then do.

svn commit -m "A comment telling what you did the which file"

or if you added some files to the working copy do:

svn add /path/to/file /path/to/otherfile

or

svn add /path/to/dir --force

which will add everything in the directory and all of it's subdirectories to the working copy, and finally

svn commit -m "who did what why"

Upvotes: 11

Ayman Hourieh
Ayman Hourieh

Reputation: 137116

You cannot commit changes without checking out a local copy of the repository first.

  1. Check out the repository into a local directory using:

    svn checkout file:///path/to/repo
    
  2. make changes.
  3. Run the following to submit your changes:

    svn commit
    

Upvotes: 2

rincewind
rincewind

Reputation: 2522

Before committing, you need to checkout a fresh copy of the just imported files. Delete (or rename) you're project directory, and do svn checkout [REPOSPATH]. Then you have a working copy. After you change a file in you're working copy, you can use svn commit.

See Getting Data into your Repository in the SVN Book.

Upvotes: 5

Sverre Rabbelier
Sverre Rabbelier

Reputation: 1496

You can use 'svn diff' to see what changes you have outstanding, and commit them with 'svn commit' (to commit all changes), or 'svn commit path/to/file1 path/to/file2' to commit only the changes to those files.

Upvotes: 1

CoolGravatar
CoolGravatar

Reputation: 5478

svn commit [PATHTOFILE]

via svn commit --help

Upvotes: 0

Mike Hordecki
Mike Hordecki

Reputation: 97081

svn commit

Upvotes: 0

Related Questions