Mac 命令行使用 Subversion(svn)

1、查看Mac是否安裝了svn

svn help

如果能看到以下信息,說明已經(jīng)安裝成功

usage: svn <subcommand> [options] [args]
Subversion command-line client.
Type 'svn help <subcommand>' for help on a specific subcommand.
Type 'svn --version' to see the program version and RA modules,
     'svn --version --verbose' to see dependency versions as well,
     'svn --version --quiet' to see just the version number.

Most subcommands take file and/or directory arguments, recursing
on the directories.  If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
   add
   auth
   blame (praise, annotate, ann)
   cat
   changelist (cl)
   checkout (co)
   cleanup
   commit (ci)
   copy (cp)
   delete (del, remove, rm)
   diff (di)
   export
   help (?, h)
   import
   info
   list (ls)
   lock
   log
   merge
   mergeinfo
   mkdir
   move (mv, rename, ren)
   patch
   propdel (pdel, pd)
   propedit (pedit, pe)
   propget (pget, pg)
   proplist (plist, pl)
   propset (pset, ps)
   relocate
   resolve
   resolved
   revert
   status (stat, st)
   switch (sw)
   unlock
   update (up)
   upgrade

Subversion 是版本控制工具。
欲取得詳細(xì)資料,請(qǐng)參閱 http://subversion.apache.org/

如果沒有安裝,推薦使用homebrew安裝

使用 Homebrew 可以安裝 一些Apple 沒有預(yù)裝的工具軟件。這些軟件可能是你需要的。 Homebrew 軟件包列表。
也可以使用 Homebrew更新Apple預(yù)裝的工具軟件。比如用brew更新ruby環(huán)境。
官方網(wǎng)站
https://brew.sh
1、安裝

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2、查看版本

    brew --version

安裝Subversion

brew install subversion

命令執(zhí)行完成后,可使用svn help確認(rèn)是否安裝成功。

2、使用svn

2.1 從本地導(dǎo)入代碼到服務(wù)器(第一次初始化導(dǎo)入)

svn import

2.2 從服務(wù)器下載代碼

svn checkout

2.3 更新服務(wù)端代碼到本地

svn update

2.4 提交本地更改到服務(wù)器

svn commit
svn commit --message xxxxxx

2.5 查看文件狀態(tài)

svn status

2.6 添加文件

svn add
svn st | awk '{if ( $1 == "?") { print $2}}' | xargs svn add

2.7 刪除文件

svn delete
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容