Skip to content

Instantly share code, notes, and snippets.

@mountcedar
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mountcedar/11174478 to your computer and use it in GitHub Desktop.
Save mountcedar/11174478 to your computer and use it in GitHub Desktop.
今更聞けないSubversionの使い方 ref: http://qiita.com/mountcedar/items/e756bb9136e3b1722bb2
Apache Subversion(アパッチ・サブバージョン SVN)はプログラムのソースコードなどを管理する集中型バージョン管理システムの一つである。元々は、CollabNet, Inc. が開発していたが、2009年11月7日にApache Incubatorプロジェクトのひとつとなり、2010年2月17日よりApacheのトッププロジェクトとなった。ライセンスはApache Licenseに準じたものとなっている。
歴史的には広く使われているバージョン管理システムの一つにCVSがあった。CVSはよくできているが、ディレクトリの移動の管理やネットワーク対応の点、不可分な更新などでやや難があった。これらCVSの問題点を解決すべく開発されたのがSubversionである。 古くからオープンソースソフトウェアの開発においてはCVSが多く使われていたが、近年ではSubversionを使用するオープンソースプロジェクトも多くなりつつある。
$ sudo yum install subversion
$ svn mkdir svn://192.168.1.2/repo/thread -m "create new project, thread"
$ cd /path/to/thread
$ svn import . svn://192.168.1.2/repo/thread/trunk -m "initial import of project, thread"
$ svn mkdir svn://192.168.1.2/repo/thread/tags -m "create tags directory in thread project"
$ svn mkdir svn://192.168.1.2/repo/thread/branches -m "create branches directory in thread project"
$ cd /path/to/thread
$ cd ..
$ mv thread thread_
$ svn co svn://192.168.1.2/repo/thread/trunk thread
$ ls
thread thread_ …
$ svn add newfile
$ svn commit newfile -m "add newfile"
$ svn commit -m "add newfile"
$ svn commit changed_file -m "update changed_file"
$ svn commit -m "update all"
$ svn update
$ sudo apt-get install subversion
$ svn copy <スナップショットをとるソースコードのアドレス> <スナップショットをとる先のアドレス(新規)>
$ svn copy svn://192.168.1.2/repo/thread/trunk svn://192.168.1.2/repo/thread/tags/yyyyMMdd -m "create new tag, yyyyMMdd"
$ svn copy svn://192.168.1.2/repo/thread/trunk svn://192.168.1.2/repo/thread/branches/yyyyMMdd -m "create new branch, yyyyMMdd"
$ svn export svn://192.168.1.2/repo/thread/tags/yyyyMMdd thread-yyyyMMdd
$ svn co svn://192.168.1.2/repo/thread/branches/yyyyMMdd thread-yyyyMMdd
$ svn export svn://192.168.1.2/repo/thread/trunk thread
$ cd /path/to/workingcopy
$ svn export . ../thread-release
$ brew install subversion
or
$ sudo port install subversion
$ svn ls svn://192.168.1.2/repo
thread/
$ svn help
<どんなコマンドがあるかの一覧が見れる>
$ svn help XXX
<XXXというコマンドの詳細(引数も含む)が見れる>
$ svn list svn://192.168.1.2/repo
thread/
$svn ls svn://192.168.1.2/repo/thread
branches/ tags/ trunk/
$ svn co svn://192.168.1.2/repo/thread/trunk thread
$ svn checkout svn://192.168.1.2/repo/thread/trunk thread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment