Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 2.86 KB

vcs.md

File metadata and controls

91 lines (64 loc) · 2.86 KB

🐌 VCS相关脚本

svn工作目录从分支(branches)切换到主干(trunk)。

命令以SVN的标准目录命名约定来识别分支和主干。 即,分支在目录branches下,主干在目录trunk下。 示例:

用法

swtrunk.sh # 缺省使用当前目录作为SVN工作目录
cp-svn-url.sh /path/to/svn/work/directory
cp-svn-url.sh /path/to/svn/work/directory1 /path/to/svn/work/directory2 # SVN工作目录个数不限制

示例

$ swtrunk.sh
# <svn sw output...>
svn work dir . switch from http://www.foo.com/project1/branches/feature1 to http://www.foo.com/project1/trunk !

$ swtrunk.sh /path/to/svn/work/dir
# <svn sw output...>
svn work dir /path/to/svn/work/dir switch from http://www.foo.com/project1/branches/feature1 to http://www.foo.com/project1/trunk !

$ swtrunk.sh /path/to/svn/work/dir1 /path/to/svn/work/dir2
# <svn sw output...>
svn work dir /path/to/svn/work/dir1 switch from http://www.foo.com/project1/branches/feature1 to http://www.foo.com/project1/trunk !
# <svn sw output...>
svn work dir /path/to/svn/work/dir2 switch from http://www.foo.com/project2/branches/feature1 to http://www.foo.com/project2/trunk !

把指定的远程分支从刚新建分支以来的修改合并到本地svn目录或是另一个远程分支。

用法

svn-merge-stop-on-copy.sh <来源的远程分支> # 合并当前本地svn目录
svn-merge-stop-on-copy.sh <来源的远程分支> <目标本地svn目录>
svn-merge-stop-on-copy.sh <来源的远程分支> <目标远程分支>

示例

svn-merge-stop-on-copy.sh http://www.foo.com/project1/branches/feature1 # 缺省使用当前目录作为SVN工作目录
svn-merge-stop-on-copy.sh http://www.foo.com/project1/branches/feature1 /path/to/svn/work/directory
svn-merge-stop-on-copy.sh http://www.foo.com/project1/branches/feature1 http://www.foo.com/project1/branches/feature2

贡献者

姜太公提供此脚本。

拷贝当前svn目录对应的远程分支到系统的粘贴板,省去CTRL+C操作。

用法

cp-svn-url.sh # 缺省使用当前目录作为SVN工作目录
cp-svn-url.sh /path/to/svn/work/directory

示例

$ cp-svn-url.sh
http://www.foo.com/project1/branches/feature1 copied!

贡献者

ivanzhangwb提供此脚本。

参考资料

拷贝复制命令行输出放在系统剪贴板上,给出了不同系统可用命令。