LoginSignup
5
6

More than 5 years have passed since last update.

FossilからGitにExportしてGitHubにpushする

Last updated at Posted at 2014-05-05

概要

Fossil のデフォルトブランチ名は master じゃなくて trunk だから注意しましょう。

実際の流れ

fossil からエクスポート & git へのインポート

git init new-repo
cd new-repo
fossil export --git ../repo.fossil | git fast-import

新しい git リポジトリを作成し、その中に入り、fossil のリポジトリを指定して情報を移行する。

PrtScrn.png

成功するとこういう上記のようなログが出る。

ここまでは fossil の公式 Wikiに記されている通り。

結果を確認

しかし、ここで履歴が移行されたか確かめるために git log しても、fatal: bad default revision 'HEAD'というエラーが出るのではないだろうか。

git ではデフォルトのブランチが master なのに対して、fossil では trunk になっているためだ。

git checkout trunk することでブランチを移行でき、git log の結果も正しく表示されるだろう。

GitHub へ push

GitHub側ではGitHubのヘルプを参考にして先にリポジトリを作る。

そして、Step 3: Push your commit のステップで git remote add origin https://github.com/[ユーザ名]/[リポジトリ名].git した次は、先ほどと同じくローカルのブランチについて master ではなく trunk を指定する必要がある。

git push origin trunk

さもないと、認証の後、

error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/[ユーザ名]/[リポジトリ名].git'

といったエラーに見舞われるだろう。

5
6
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
5
6