
ntfs-3gパーティションで新しいgitリポジトリを初期化しようとすると、このエラーが発生します。
% git init .
error: chmod on /mnt/abc/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'
同じコマンドを実行すると動作sudo git init .
します。
一般ユーザーとしてtouch test.txt
ファイルを編集して保存できます。
これは猫の結果です。/etc/fstab
UUID=4ED0581F0CC0C861 /mnt/abc ntfs-3g rw,user,exec,auto,umask=000 0 2
私もこれを見つけましたが、make
sudocmake
も必要です。
アップデート1
出力は次のとおりですls -l /mnt/abc/.git
。
total 2
-rwxrwxrwx 1 root root 23 Dec 25 16:46 HEAD
drwxrwxrwx 1 root root 0 Dec 25 16:46 branches
-rwxrwxrwx 1 root root 93 Dec 25 16:46 config
-rwxrwxrwx 1 root root 73 Dec 25 16:46 description
drwxrwxrwx 1 root root 528 Dec 25 16:46 hooks
drwxrwxrwx 1 root root 144 Dec 25 16:46 info
drwxrwxrwx 1 root root 240 Dec 25 16:46 objects
drwxrwxrwx 1 root root 240 Dec 25 16:46 refs
ここで出力ls -l /mnt/abc/.git/config.lock
ls: cannot access '/mnt/rest/temp/.git/config.lock': No such file or directory
ここで出力ls -l /mnt/abc/.git/config
-rwxrwxrwx 1 root root 93 Dec 25 16:46 /mnt/rest/temp/.git/config
アップデート2
@jsbillingsのコメントのリンクをたどった後、fstabエントリを次のように変更しました(umask = 000を削除しました)。
UUID=5FC0580F0BC0C835 /mnt/abc ntfs-3g rw,user,exec,auto 0 2
それからumount mnt/abc
私とmount mnt/abc
。問題が解決したようです。今git .init
実行してくださいcmake
。