LoginSignup
6
5

More than 5 years have passed since last update.

メモ:今日覚えたgit:fileModeとdenyCurrentBranch

Posted at

メモ:今日覚えたgitのコマンド。

fast-export

Mercurialからgitのレポジトリに変換する。
https://github.com/frej/fast-export

ただし、defaultが複数あるとかエラーで変換してくれない場合に遭遇。こんなエラーメッセージ。

Error: repository has at least one unnamed head: hg r790

オプション--forceをつけると動いた。

hg-fast-export.sh -r <repo> --force

参考:http://learnaholic.me/2013/02/01/converting-mercurial-hg-to-git-repository-on-mac/

fileMode

ファイルパーミッションの変更を無視する方法。異なるOSでレポジトリを操作するとファイルのパーミッションが変わってしまう(SMBでもDropBoxでも経験済み)。そんな時は、

git config core.fileMode false  

denyCurrentBranch

ファイル上でgithubみたいに、pull&pushしたい場合、一般的にはbareなレポジトリを作成する。そうしたくない場合は、他のリポジトリからのpushを受け取るように設定を変更できる。

git config --add receive.denyCurrentBranch ignore

で、それがなぜ危険かは、ここに詳しい。
http://d.hatena.ne.jp/nishiohirokazu/20120416/1334548800

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