1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gollum で bare リポジトリを wiki に使う

Posted at

Gollim で bare リポジトリを wiki に使おうとしたところ・・・

$ vi Gemfile
source "https://rubygems.org"
gem "gollum"
$ bundle install --path=vendor/bundle
$ git init --bare /tmp/wiki
$ bundle exec gollum /tmp/wiki

http://localhost:4567 を開くと Grit::InvalidGitRepositoryError というエラーになりました。

bare リポジトリは使えへんのかーと思ってソースを眺めていたら repo_is_bare というオプションを発見しました。

次のように config.ru を作って rackup すると上手くいきました。

require 'gollum/app'

gollum_path = '/tmp/wiki'

Precious::App.set(:gollum_path, gollum_path)
Precious::App.set(:default_markup, :markdown)
Precious::App.set(:wiki_options, {
    :repo_is_bare  => true,
})

run Precious::App

コマンドラインからこのオプションを指定する方法は無さそうです。
gollum コマンドはサーバじゃなくローカルでの利用を想定しているので bare リポジトリは使えないのでしょう。


という勘違いをしていました。

ディレクトリ名に .git を含めれば bare リポジトリでも大丈夫でした。

$ git init --bare /tmp/wiki.git
$ bundle exec gollum /tmp/wiki.git

普通 bare リポジトリは REPO.git のようなディレクトリ名にするとは思いますが、自動で判断してくれても良いのでは? と思わなくもないです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?