centos中SVN使用操作技巧

來源:互聯網
上載者:User

SVN 分支合并修改合并到主幹上

在主幹分支上執行下面命令

$ svn merge --reintegrate 分支URL/album_mdl.php
--- Merging differences between repository URLs into 'album_mdl.php':
U    album_mdl.php
--- Recording mergeinfo for merge between repository URLs into 'album_mdl.php':
 U   album_mdl.php

SVN 建立分支

執行一下命令可以建立一個分支。

$ svn cp -m 'create new branch for dev' http://主乾地址 http://分支地址

SVN刪除分支

$ svn rm http://分支地址 -m 'delete the dev branch'

SVN分支同步主幹最新內容

需要在分支目錄中執行如下命令

$ svn merge http://主乾地址

SVN復原緩衝的改變

$ svn revert . -R

SVN 替換服務地址

$ svn switch --relocate 原倉庫ROOT地址  新倉庫ROOT地址

實現SVN內容同步更新,當進行檔案提交的時候,自動將提交的內容更新到另一個位置。
如同步更新到Web伺服器以實現即時發布。

在倉庫目錄下的 hooks檔案夾下,建立post-commit.bat檔案。

@echo off
"D:\Program Files\VisualSVN\bin\svn.exe" update "E:\BaiDuYun\備份資料\SVN備份" –username testuser –password testpwd

如果出現檔案唯讀等錯誤,則需要修改Svn伺服器的執行許可權。
在服務中的SVN服務中修改SVN的登陸身份為administrator即可

清除目錄下所有的.svn檔案

find . -type d -name ".svn"|xargs rm -fr

該命令中,-type用於指定尋找的檔案類型,d為目錄類型(如果為f則為標準檔案),-name指定尋找的檔案名稱為.svn。
xargs命令將find尋找到的列表按照每一行分成一段,對每一段執行rm -fr命令。

對於xargs命令的使用,可以舉個例子,建立檔案touchlist.txt,檔案內容如下:

file1
file2
file3
file4

執行命令cat touchlist.txt|xargs touch,可以看到,目前的目錄下自動建立了如下檔案:

localhost:test mylxsw$ ll
total 8
-rw-r--r--  1 mylxsw  staff   0  9 12 11:56 file1
-rw-r--r--  1 mylxsw  staff   0  9 12 11:56 file2
-rw-r--r--  1 mylxsw  staff   0  9 12 11:56 file3
-rw-r--r--  1 mylxsw  staff   0  9 12 11:56 file4
-rw-r--r--  1 mylxsw  staff  24  9 12 11:55 touchlist.txt

要清理目錄下所有指定的檔案,可以使用命令find . -type f -name "*.xml" -print0|xargs -0 rm -fr,該命令解決了檔案名稱中包含空格而出現的xargs: unterminated quote錯誤。

移動指定目錄下指定類型的檔案

# find . -name "*.mkv"|xargs -I {} mv {} /dest/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.