开发者

SVN Import Force for importing existing file

I am creating a text file and a ZIP file for a tag automatically with MSBuild. My MSBuild project is called b开发者_如何学编程y CruiseControl.NET.

The text file is always going to be latest.txt and the ZIP file will be (version).zip (so it will be different every time). I do not want to commit these files back to my trunk nor check out the tags directory.

Hence, I discovered svn import. The first time it works for both. On successive runs, it fails since latest.txt already exists in the repository. Do I need to use svn import --force or something else to get these two files pushed up to my repository?


Based on the comments, the answer to the question would be to only svn import the (version).zip file. Since the contents of latest.txt change for each build, it is a versioned file and should be committed as such.


If I understood your problem correctly, svn import can help you.

svn import allows you to commit an unversioned file into the repository.


If it is a new file on the repo, it works perfectly.

But if there is such a file on the repo already, it doesn't work -- you cannot use svn import to commit to an existing path.

The workaround would be to delete the repo file first, and then import it back again.

  • Delete command: svn delete URL -m "deleting for update"
  • Import command: svn import PATH URL -m "<your message here>"

You will lose the file history, but it's a nice way of making straightforward updates to simple files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜