SVN导入后如何提交更改?

时间:2009-05-03 20:59:34

标签: svn

我创建了一个项目,并使用了svn import。现在我想对文件进行更改,如何做到这一点?

我有空~/.workspace/project/.svn/entries

如果我尝试svn commit,我会得到这个:

$ 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 

目录

...或只是svn commit

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

6 个答案:

答案 0 :(得分:11)

svn import将未版本控制的文件提交到存储库(可能是在远程主机上)。完成此操作后,您需要使用

将存储库签出为您自己的计算机作为工作副本
svn checkout http://some.repository.net/trunk/ /my/local/path/to/workingcopy

将从回购到您的机器的行李箱结帐到文件夹/ my / local / path / to / workingcopy。改变然后做。

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

或者如果您将一些文件添加到工作副本中:

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

svn add /path/to/dir --force

将目录中的所有内容及其所有子目录添加到工作副本中,最后

svn commit -m "who did what why"

答案 1 :(得分:5)

在提交之前,您需要签出刚刚导入的文件的新副本。删除(或重命名)您的项目目录,然后执行svn checkout [REPOSPATH]。 然后你有一个工作副本。更改了工作副本中的文件后,可以使用svn commit

请参阅SVN手册中的Getting Data into your Repository

答案 2 :(得分:2)

如果不首先签出存储库的本地副本,则无法提交更改。

  1. 使用以下命令将存储库签入本地目录:

    svn checkout file:///path/to/repo
    
  2. 进行更改。
  3. 运行以下内容提交更改:

    svn commit
    

答案 3 :(得分:1)

您可以使用'svn diff'查看未完成的更改,并使用'svn commit'(提交所有更改)提交它们,或者'svn commit path / to / file1 path / to / file2'提交只对这些文件进行了更改。

答案 4 :(得分:0)

svn commit

答案 5 :(得分:0)

svn commit [PATHTOFILE]

通过svn commit --help

相关问题