使用免费的SVN服务器

北城以北 提交于 2020-08-19 19:54:35

在本地环境中安装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提交使用的一个小例子就这样完成了。

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!