LoginSignup
3
1

More than 5 years have passed since last update.

GitHubから「.git」なしでリポジトリをエクスポートする。または、リポジトリのサブディレクトのみエクスポートする。

Last updated at Posted at 2017-04-05


あまり知られてませんが、GitHub には「Subversionサポート」機能があります【脚注1

この機能を利用してリポジトリをエクスポートするには、Subversion クライアント(svnコマンド)がインストールされている必要があります。(後で本文に組み込みますが、svnコマンドのインストール方法については、この記事のコメントに書き込みましたのでご覧ください)

  • Subversionのサーバーは要りません。svnコマンドが使えれば良いです…gitコマンド(gitクライアント)を使うのにgitサーバーを自分で立てる必要がないのと同じことです。

  • GitHubのサーバーが「Gitサーバー」兼「(仮想の)Subversionサーバー」として振る舞うということです。

https://github.com/apache/thrift (Apache Thrift【脚注2】)というリポジトリーがありますが、このリポジトリをサンプルとしてご説明します。

  • リポジトリのmasterから、リポジトリ全体をエクスポートするには以下のコマンドを実行します。「thrift-master」というフォルダにエクスポートするコマンドです。
svn export https://github.com/apache/thrift/trunk thrift-master
  • また、「Subversionサポート」機能では、リポジトリのサブフォルダのみを取り出すことができます。
svn export https://github.com/apache/thrift/trunk/test thrift-master-test
  • ブランチ(0.5.x)を指定してリポジトリ全体をエクスポートする例。
svn export https://github.com/apache/thrift/branches/0.5.x thrift-0.5.x
  • ブランチ(0.5.x)のサブフォルダ(test)をエクスポートする例。
svn export https://github.com/apache/thrift/branches/0.5.x/test thrift-0.5.x-test
  • タグを指定してリポジトリ全体をエクスポートする例。
svn export https://github.com/apache/thrift/tags/0.9.3 thrift-tag-0.9.3
  • タグを指定してサブフォルダをエクスポートする例。
svn export https://github.com/apache/thrift/tags/0.9.3/test thrift-tag-0.9.3-test

#後で、校正・加筆するかもしれません。

😲セーラームーン / ムーンライト伝説 (ユーロビート)ver.

  1. https://help.github.com/articles/support-for-subversion-clients/ 『Support for Subversion clients - GitHub User Documentation』 

  2. https://www.ibm.com/developerworks/jp/opensource/library/os-cloud-apache-thrift/ 『スケーラブルなクラウド・ソフトウェアの開発を Apache Thrift で単純化する』 

3
1
8

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1