How do I add File to SVN without Checking out

不问归期 提交于 2019-12-18 18:36:21

问题


I would like to add a file to a remote svn repository without checking out the project.

svn add requires the project to be checked out

svn import seems to only import directories

Any ideas?


回答1:


You should be able to use svn import:

$ svn help import
import: Commit an unversioned file or tree into the repository.

Import is able to add individual files and trees to a repository.




回答2:


I think it got it. The secret is to include the file name on the url

svn import -m "Adding just a file" file_name http://path/to/svn/repo/file_name



回答3:


This might not be what you are looking for but you can use -N flag to checkout a code non-recursively.

Example:

svn co -N http://svn.example.com/repo/trunk

This will not checkout all the sub-directories. Which is much faster if you are just trying to add a file.




回答4:


SCMs are meant to version your code. Perhaps you want to use an FTP server.



来源:https://stackoverflow.com/questions/4000587/how-do-i-add-file-to-svn-without-checking-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!