LoginSignup
2
2

More than 5 years have passed since last update.

cygwin上でlinux.gitをcloneするとハマる件について

Posted at

大人の事情でcygwin上でlinux.gitをモニョる必要があった...

shot-yourself-in-t3h-f00t
$ cd ${GIT_REPOS}
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ cd linux
$ git status -s
 M include/uapi/linux/netfilter/xt_CONNMARK.h
[SNIP]

...は?

shot-yourself-in-t3h-f00t-again
$ git reset --hard
$ git status -s
 M include/uapi/linux/netfilter/xt_CONNMARK.h
[SNIP]

$ for f in $(git status -s | awk '{$2}') ; do git checkout HEAD $f ; done
$ git status -s
 M include/uapi/linux/netfilter/xt_CONNMARK.h
[SNIP]

$ cd ${TMP}
$ wget ftp://ftp.ring.gr.jp/pub/linux/kernel.org/kernel/v3.x/linux-3.10.tar.xz
$ tar -xvJf linux-3.10.tar.xz
[SNIP]
$ cd ${GIT_REPOS}
$ for f in $(git status -s | awk '{$2}') ; do cp ${TMP}/linux-3.10/$f $f ; done
$ git status -s
 M include/uapi/linux/netfilter/xt_CONNMARK.h
[SNIP]

おぅ,しっと...

ヤクの毛刈りの結果,case-insensitiveが原因と判明.
Git-windows case sensitive file names not handled properly
Case sensitive filenames
The Cygwin Mount Table

なので,regedit.exeで,

use-this-fsckin-bullet-for-t3h-next
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive

を0にして,再起動.
/etc/fstabがデフォルトのままなら,/cygdrive/[a-z]以下以外はcase-sensitiveになるので,
改めて,git reset --hardすれば解決する.

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