使用免費的SVN服務器


在本地環境中安裝SVN

window版本自行搜索圖文教程。

linux版本(以我的 ubuntu 為例子)

我嘗試直接敲SVN

svn

報錯

Command 'svn' not found, but can be installed with:

apt install subversion
Please ask your administrator.

然后我就按照它說的執行 sudo apt install subversion

 sudo apt install subversion

得到結果

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  docbook-xml docbook-xsl fcitx-libs fonts-dejavu gconf2 gnome-applets-data gnome-system-monitor golang-1.10-go golang-1.10-race-detector-runtime golang-1.10-src golang-race-detector-runtime golang-src
  icoutils kde-runtime kde-runtime-data kde-style-breeze kde-style-breeze-qt4 kdelibs-bin kdelibs5-data kdelibs5-plugins kdiff3-doc kdoctools kwayland-data kwayland-integration libattica0.4 libcpufreq0
  libdbusmenu-qt2 libdlrestrictions1 libfam0 libfcitx-qt0 libgpgme++2v5 libgucharmap-2-90-7 libkactivities6 libkcmutils4 libkde3support4 libkdeclarative5 libkdecore5 libkdesu5 libkdeui5 libkdewebkit5
  libkdnssd4 libkemoticons4 libkf5archive5 libkf5auth-data libkf5auth5 libkf5codecs-data libkf5codecs5 libkf5config-bin libkf5config-data libkf5configcore5 libkf5configgui5 libkf5configwidgets-data
  libkf5configwidgets5 libkf5coreaddons-data libkf5coreaddons5 libkf5guiaddons5 libkf5i18n-data libkf5i18n5 libkf5iconthemes-bin libkf5iconthemes-data libkf5iconthemes5 libkf5idletime5
  libkf5itemviews-data libkf5itemviews5 libkf5style5 libkf5waylandclient5 libkf5widgetsaddons-data libkf5widgetsaddons5 libkf5windowsystem-data libkf5windowsystem5 libkfile4 libkhtml5 libkio5 libkjsapi4
  libkjsembed4 libkmediaplayer4 libknewstuff3-4 libknotifyconfig4 libkntlm4 libkparts4 libkpty4 libkrosscore4 libktexteditor4 libkxmlrpcclient4 libllvm8 libntrack-qt4-1 libntrack0 libopencc2
  libopencc2-data libphonon4 libplasma3 libpolkit-qt-1-1 libpolkit-qt5-1-1 libqca2 libqca2-plugins libqt4-designer libqt4-opengl libqt4-qt3support libqt4-svg libqt5script5 libqtwebkit4 libsolid4
  libstreamanalyzer0v5 libstreams0v5 libthreadweaver4 libxml2-utils ntrack-module-libnl-0 oxygen-icon-theme phonon phonon-backend-gstreamer phonon-backend-gstreamer-common plasma-scriptengine-javascript
  sgml-data xml-core
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libserf-1-1 libsvn1
Suggested packages:
  db5.3-util libapache2-mod-svn subversion-tools
The following NEW packages will be installed:
  libserf-1-1 libsvn1 subversion
0 upgraded, 3 newly installed, 0 to remove and 231 not upgraded.
Need to get 2,061 kB of archives.
After this operation, 9,380 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libserf-1-1 amd64 1.3.9-6 [44.4 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libsvn1 amd64 1.9.7-4ubuntu1 [1,183 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 subversion amd64 1.9.7-4ubuntu1 [834 kB]
Fetched 2,061 kB in 3s (627 kB/s)   
Selecting previously unselected package libserf-1-1:amd64.
(Reading database ... 289141 files and directories currently installed.)
Preparing to unpack .../libserf-1-1_1.3.9-6_amd64.deb ...
Unpacking libserf-1-1:amd64 (1.3.9-6) ...
Selecting previously unselected package libsvn1:amd64.
Preparing to unpack .../libsvn1_1.9.7-4ubuntu1_amd64.deb ...
Unpacking libsvn1:amd64 (1.9.7-4ubuntu1) ...
Selecting previously unselected package subversion.
Preparing to unpack .../subversion_1.9.7-4ubuntu1_amd64.deb ...
Unpacking subversion (1.9.7-4ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libserf-1-1:amd64 (1.3.9-6) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up libsvn1:amd64 (1.9.7-4ubuntu1) ...
Setting up subversion (1.9.7-4ubuntu1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

之后執行 SVN

svn

得到

Type 'svn help' for usage.

然后我就按照它說的執行 svn help

svn help
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
  or '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 is a tool for version control.
For additional information, see http://subversion.apache.org/

好像可以用了。

然后去 https://svnbucket.com 注冊登錄一下 創建一個項目

 

比如我創建了一個 hncj-bys 的項目 

 

 

 

 然后就有了svn地址

 

 

svn://svnbucket.com/renzhewudi/hncj-bys/

然后我就在linux命令行執行這個

svn checkout svn://svnbucket.com/renzhewudi/hncj-bys/

然后就有了

 

 

 好了 可以開始添加東西了。

然后我創建一個文件

touch readme.txt

然后編輯這個文件(我用的是vscode編輯器 用其他的也行)

code readme.txt

 

 然后保存,開始提交

svn add readme.txt

系統提示

A  (bin)  readme.txt

然后添加commit message

svn commit -m "HNCJ-BYS: 000001 - Add first file about read me."

提示如下:

Adding  (bin)  readme.txt
Transmitting file data .done
Committing transaction...
Committed revision 1.

現在去網頁上看一下提交記錄發現了

 

好了,就這樣SVN提交使用的一個小例子就這樣完成了。


免責聲明!

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



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