svn之svn:ignore命令行設置


svn help 中有 propset propget propdel proplist propedit五個關於prop,也就是svn屬性的設置。

在當前的svn工作拷貝下,svn status有些文件總是提示? 很煩人,所以希望通過設置svn:ignore來避免這種無聊的提示,試了幾下命令,不行,還是看看 svn help propedit吧,終於弄懂了。

一下是svn的這個幫助信息:

View Code
propset (pset, ps): Set the value of a property on files, dirs, or revisions.
usage: 1. propset PROPNAME PROPVAL PATH...
2. propset PROPNAME --revprop -r REV PROPVAL [TARGET]

1. Changes a versioned file or directory property in a working copy.
2. Changes an unversioned property on a repository revision.
(TARGET only determines which repository to access.)

The value may be provided with the --file option instead of PROPVAL.

Note: svn recognizes the following special versioned properties
but will store any arbitrary properties set:
svn:ignore - A newline separated list of file glob patterns to ignore.
svn:keywords - Keywords to be expanded. Valid keywords are:
URL, HeadURL - The URL for the head version of the object.
Author, LastChangedBy - The last person to modify the file.
Date, LastChangedDate - The date/time the object was last modified.
Rev, Revision, - The last revision the object changed.
LastChangedRevision
Id - A compressed summary of the previous
4 keywords.
Header - Similar to Id but includes the full URL.
svn:executable - If present, make the file executable. Use
'svn propdel svn:executable PATH...' to clear.
svn:eol-style - One of 'native', 'LF', 'CR', 'CRLF'.
svn:mime-type - The mimetype of the file. Used to determine
whether to merge the file, and how to serve it from Apache.
A mimetype beginning with 'text/' (or an absent mimetype) is
treated as text. Anything else is treated as binary.
svn:externals - A newline separated list of module specifiers,
each of which consists of a URL and a relative directory path,
similar to the syntax of the 'svn checkout' command:
http://example.com/repos/zig foo/bar
A revision to check out can optionally be specified to pin the
external to a known revision:
-r25 http://example.com/repos/zig foo/bar
To unambiguously identify an element at a path which has been
deleted (possibly even deleted multiple times in its history),
an optional peg revision can be appended to the URL:
-r25 http://example.com/repos/zig@42 foo/bar
Relative URLs are indicated by starting the URL with one
of the following strings:
../ to the parent directory of the extracted external
^/ to the repository root
// to the scheme
/ to the server root
The ambiguous format 'relative_path relative_path' is taken as
'relative_url relative_path' with peg revision support.
Lines in externals definitions starting with the '#' character
are considered comments and are ignored.
Subversion 1.4 and earlier only support the following formats
where peg revisions can only be specified using a -r modifier
and where URLs cannot be relative:
foo http://example.com/repos/zig
foo/bar -r 1234 http://example.com/repos/zag
Use of these formats is discouraged. They should only be used if
interoperability with 1.4 clients is desired.
svn:needs-lock - If present, indicates that the file should be locked
before it is modified. Makes the working copy file read-only
when it is not locked. Use 'svn propdel svn:needs-lock PATH...'
to clear.

The svn:keywords, svn:executable, svn:eol-style, svn:mime-type and
svn:needs-lock properties cannot be set on a directory. A non-recursive
attempt will fail, and a recursive attempt will set the property
only on the file children of the directory.

有效選項:
-F [--file] ARG : 從文件 ARG 讀取屬性值
--encoding ARG : 將ARG的值視為字符編碼
-q [--quiet] : 不打印信息,或只打印概要信息
-r [--revision] ARG : ARG (一些命令也接受ARG1:ARG2范圍)
版本參數可以是如下之一:
NUMBER 版本號
'{' DATE '}' 在指定時間以后的版本
'HEAD' 版本庫中的最新版本
'BASE' 工作副本的基線版本
'COMMITTED' 最后提交或基線之前
'PREV' COMMITTED的前一版本
--targets ARG : 傳遞文件 ARG 內容為附件參數
-R [--recursive] : 向下遞歸,與 --depth=infinity 相同
--depth ARG : 限制操作深度是 ARG ('empty', 'files',
'immediates', 或 'infinity')
--revprop : 在版本屬性上操作(使用-r參數)
--force : 強制操作運行
--changelist [--cl] ARG : 只能對修改列表 ARG 的成員操作

全局選項:
--username ARG : 指定用戶名稱 ARG
--password ARG : 指定密碼 ARG
--no-auth-cache : 不要緩存用戶認證令牌
--non-interactive : 不要交互提示
--trust-server-cert : accept SSL server certificates from unknown
certificate authorities without prompting (but only
with '--non-interactive')
--config-dir ARG : 從目錄 ARG 讀取用戶配置文件
--config-option ARG : 以下屬格式設置用戶配置選項:
FILE:SECTION:OPTION=[VALUE]
例如:
servers:global:http-library=serf
ayanmw@ayanmw-desktop:/data/gps-svn/trunk/GPSServer$ svn propset  svn:ignore "*.class
*.o
*.out
.gdbinit
.cproject
.project
" .
設置屬性 “svn:ignore” 於 “.”


ayanmw@ayanmw-desktop:/data/gps-svn/trunk/GPSServer$ svn plist
“.” 上的屬性:
svn:ignore
svn:mergeinfo


ayanmw@ayanmw-desktop:/data/gps-svn/trunk/GPSServer$ svn pget svn:ignore
*.class
*.o
*.out
.gdbinit
.cproject
.project


開始我自己嘗試的時候 由於沒有加上路徑. 以為默認會有這個呢。。總提示錯誤,也不提示具體錯誤,直接讓看help。后來加了. 路徑 就OK了!


 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM