How to use a subversion repository as a template for new projects?

感情迁移 提交于 2019-12-11 15:17:48

问题


I created a customised version of Wordpress for us to use as a template for our web projects, stored in an svn repository.

It has various properties set (ignores, wordpress + plugins as externals) to ease workflow and updates.

My question is, how to use this as a base for others projects / repositories?

  • If you export, it loses all the properties.

  • If you checkout, it is a working copy of the template repository and cannot be imported / committed to a new repository (?)

Should branches be used in this case? It doesn't seem right, as the projects will never be merged back into the template (though I guess some parts might be).


回答1:


It is ok to have then as branches. You can keep track of overall updates in the main version, and apply to the branches when appropriate.

Ps. if you still want to use it as a template, there is an already answered question about it: Is there a way to use a repository as a "template" to start a new repository?




回答2:


Import your customized version and SVN copy to a new locations. This works if you plan to develop in the same repo. Otherwise export and import to another repo.




回答3:


I would add a bat to your template that sets the required properties with "svn propset" and afterwards deletes itself.

A user would export the template, add the files to a new repository and the run the propset bat.

EDIT:

I meant a batch file. You can look what properties you currently have with svn proplist and svn propget. In your setprop.bat you would then call svn propset, e.g.:

svn propset svn:ignore *.bak dir1
svn propset svn:ignore *.etc dir2
svn propset svn:externals "extdir svn://domain/trunk" . 


来源:https://stackoverflow.com/questions/682761/how-to-use-a-subversion-repository-as-a-template-for-new-projects

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