This is just a note to myself, since I seem to keep forgetting how to do that properly. After reading the chapter in the svn-book properly and using enough [–]help I figured it out and I am scared to forget how to get it right again :-). Here is how I got it working for me.
svn:ignore
-
cdinto the root directory of my working copy. - Create a file .svnignore in the root of my working copy, with the following content
*.pyc
*.log
adjust that as you need it, of course.
Runsvn -R propset svn:ignore -F .svnignore .
Note the “.” at the end (that I always forgot in the beginning), that means all the directories get effected. The “-R” means that the ignore shall apply recursively, therefore you need to be in the root to have it apply to the entire tree. Now commit all the directories, yes you have to commit them all,
svn commit * -m"set ignore"
that was also not mentioned in the svn-book, I think. But how boring would the world be without those little challenges? And now run
svn status
and all the files that shall be ignored should be gone.
So notice here, ignore works on the directories, I believe. That’s why you also have to use the “.” and when commiting you see that all the directories get commited.
svn:keywords
-
cdinto the root directory of my working copy. - Create a file .keywords in the root of my working copy, with the following content
Author
Rev
Id
adjust that as you need it, of course.
Runsvn -R propset svn:keywords -F .keywords *
Note the “*” at the end (that I also always forgot in the beginning), that tells that all the files are effected. The “-R” means that the keywords shall apply recursively, therefore you need to be in the root to have it apply to the entire tree. SubVersion has modified all the files that contain those place-holders (like $Id$, $Rev$, etc.) and has replaced them with the proper content. Now commit all the files (now really the files have changed!), here too - you have to commit them all,
svn commit * -m"set keywords" .
So notice here, keywords works on the files. That’s why you also have to use the “*” and when commiting you see that all the files get commited.
本文详细介绍了如何使用Subversion (SVN) 的svn:ignore 和svn:keywords 属性来忽略特定文件类型及设置文件关键词。通过创建.svnignore 和.keywords 文件,并使用svn propset 命令进行配置,可以有效地管理版本控制系统中的文件忽略规则和关键词替换。
1万+

被折叠的 条评论
为什么被折叠?



