tags:

views:

378

answers:

4

hi, Can anyone tell me the command for updating a file in the svn repository. Already the file is imported,I just want to modify the changes.

The file is main.css and the filepath is /home/weblab/public_html/cake_1_2/app/webroot/css.

Can someone give me the exact command?

+1  A: 

svn ci filename

Philippe Leybaert
I either get the error it is not a working copy or Can't open file '/.svn/entries': No such file or directory
Angeline Aarthi
+1  A: 

Quick answer: Use 'Commit'

Well, which OS, which client?

If on windows, TortoiseSVN is best.

NinethSense
its ubuntu.. and commit did work,or i didnt mention the path correctly i suppose..
Angeline Aarthi
+3  A: 

There's three ways to interpret your question:

  1. You only have the file in a subversion repository, and you want to modify its contents
  2. You have the file both in a repository and on disk, no changes done yet, and you want to modify its contents both places
  3. You have the file both in a repository and on disk, the file on disk contains changes, and you want to update the repository version with those changes

If the first, you need to first check out the file to a working copy on disk, then you move on to case 2.

If the second, you need to modify the file on disk with the changes, and then move on to case 3.

If the third, you need to commit the changes to the repository.

You do this with your chosen Subversion client. If this is the command line, a typical command looks like this:

svn ci -m "Text that describes the changes that were done"

The real problem here though is that you don't know how to use Subversion. I would find a Subversion tutorial and play around with it, create a temporary repository and put files into it, play around with the commit, checkout, revert, log, etc. commands to get a feel for how the system works.

Lasse V. Karlsen
Mine is the third case.Is there no need to mention the file name?
Angeline Aarthi
By default, Subversion will commit any modified file under the working directory. If you only want to commit one file, you can add its path as an additional parameter to the commit command.
Vincent Robert
Concerning Subversion tutorials: http://svnbook.red-bean.com/ is an excellent free e-book for the introduction to version control in general and svn in particular.
balpha
+2  A: 

I'm guessing that you have used "svn import" to get the files into the repository. If that is the case, then your local file on disk is not part of a working copy and you will not be able to "svn commit" it.

In order to verify this, run "svn info" from the directory your code is in. If it says: "svn: '.' is not a working copy", your current directory is not a working copy.

What you then need to do is:

  1. "svn checkout" your project from the repository to a local working copy (temporary directory).
  2. copy your changes to the existing files over the working copy
  3. "svn commit" those changes.

After you've done that, rename the original project location (where you were working now) and move the working copy in it's place. You can now "svn commit" as normal from your working copy.

If the folder you use now is called: /home/username/myproject and the working copy is called /tmp/workingcopy. Then you could type the following:

  1. mv /home/username/myproject /home/username/myproject.old
  2. mv /tmp/workingcopy /home/username/myproject

Now continue your work in /home/username/myproject, you can delete myproject.old if you are sure all of your code is in the svn repository

Gerco Dries
You are absolutely correct. Now I'm able to update in svn.But I dont understand the second part. How to make my project location as the working location? I'm working in cakephpnow. How to move the working copy into my cakephp folder and use it?
Angeline Aarthi
Please see my addition to the answer above for how to replace your folder with the svn working copy.
Gerco Dries