LoginSignup
0
0

More than 1 year has passed since last update.

git-svnオフライン実験環境構築メモ

Last updated at Posted at 2021-05-27

概要

ローカルに実験環境を構築する。
Windows PC1台で完結させる。
後半の詳細は下の記事を参照。記事が消えてしまったときのために、実行したコマンド等のメモは残しておく。

  • 環境

    • Windows 10
    • Subversion 1.13.0
    • Tortoise SVN 1.13.1
    • Git 2.18.0.windows.1
  • 手順

    1. Subversionのローカルリポジトリを作成
    2. svnserveを起動
    3. git-svnでSubversionのローカルリポジトリをclone

Subverion ローカルリポジトリ作成

cd f:\test

@REM ローカルリポジトリ作成
svnadmin create test_rep

@REM trunk作成
mkdir trunk
svn import trunk file:///f:/test/test_rep -m "create trunk"
rmdir trunk

@REM 試しにチェックアウト
mkdir work
cd work
svn checkout file:///f:/test/test_rep/trunk

svnserve

git-svnでfile:///形式のURLのリポジトリをcloneしようとしてもできなかった。

失敗例
> git svn clone file:///f:/test/test_rep
Initialized empty Git repository in D:/test/gsvn/test_rep/.git/
Can't create session: Unable to connect to a repository at URL 'file:///f:/test/test_rep': Unable to open repository 'file:///f:/test/test_rep' at C:/Program Files/Git/mingw64/share/perl5/Git/SVN.pm line 148.

svnserveを介してsvn:形式のURLでアクセス可能になる。
svnserveを起動する。--rootのパス指定にfile:///は不要。

svnserve -d --root f:/test/test_rep

参考: git-svnでfile:///形式のリポジトリを連携する - Qiita

git-svnでclone

git svn clone svn://localhost

git-svnでdcommit

svnserve側で認証設定をしないと書き込み権限がないのでdcommitはできない。
試していないので情報のみ記載。

svnserveの認証で失敗しているので、configファイルを作って認証なしで書き換え(write)可能となるように編集します。
本当はユーザ/パスワードを設定できるらしいのですが、今回はローカルのサーバなので割愛。
git-svnでfile:///形式のリポジトリを連携する - Qiita

0
0
0

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
0
0