LoginSignup
3
1

More than 5 years have passed since last update.

gitでcheckoutでpermission deniedが出る問題

Last updated at Posted at 2018-05-14

はじめに

gitでブランチをきりcheckoutするとPermission deniedされてしまう問題が発生したので,その解決方法についてまとめます.
※git初心者なので説明に誤りがあったらすみません

問題の写真がこちらです.
https://gyazo.com/b7c7851132e633f3fd5b76070404c8e8
「fatal: .git/index: index file open failed: Permission denied」
とPermission deniedされていしまいます.
「.git/index」のパーミッションが変わっているのが原因のようです.

以下のように「ls -la .git/index」とするとわかります
https://gyazo.com/6f3704b6e10dc5285103167b7113233d

なので,以下のようにパーミッションを644に変更するとうまくいきました

https://gyazo.com/cb3ce2714682043096f5d5071afa6d0c

環境

Windows 10
WSL(Windows Subsystem for Linux)
Pc : HP HP Spectre x360

参考リンク

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