前提・実現したいこと
私は今N予備校のWebプログラミングを勉強しているのですが、
教材の通りにやっていたらうまくいかないところが出ました。
Virtual Box上にUbuntuをインストールして作業しています。
githubからカレントディレクトリにフォルダをgit cloneしようとすると
fatal: could not set 'core.filemode' to 'false'となるため
うまくgit cloneができません。
エラーメッセージ
以下にうまくいかなかった状態を示します。
現在のカレントディレクトリの内容です
console
1vagrant@ubuntu-bionic:~/workspace$ ls 2bot itunes-topsong-rss niconico-ranking-rss tmp 3httpd my-first-shell rsa.txt
ここにcloneしようとします。
console
1vagrant@ubuntu-bionic:~/workspace$ git clone git@github.com:yosse95ai/assessment.git 2Cloning into 'assessment'... 3error: could not write config file /home/vagrant/workspace/assessment/.git/config: Operation not permitted 4fatal: could not set 'core.filemode' to 'false' 5vagrant@ubuntu-bionic:~/workspace$ ls 6assessment httpd my-first-shell rsa.txt 7bot itunes-topsong-rss niconico-ranking-rss tmp 8vagrant@ubuntu-bionic:~/workspace$ ls assessment/ -a 9. .. .git
実際はassessmentディレクトリ内に
assessment.html,assessment.css,assessment.jsというファイルが存在していますが、
うまくいっていないみたいなので、削除しようとしました。
console
1vagrant@ubuntu-bionic:~/workspace$ rm -r assessment/ 2rm: cannot remove 'assessment/.git/branches': Protocol error 3rm: cannot remove 'assessment/.git/hooks': Protocol error 4rm: cannot remove 'assessment/.git/info': Protocol error 5rm: cannot remove 'assessment/.git/refs/heads': Protocol error 6rm: cannot remove 'assessment/.git/refs/tags': Protocol error 7rm: cannot remove 'assessment/.git/refs': Directory not empty
うまくいかなかったのでgit rmコマンドを使おうとしてみました。
console
1vagrant@ubuntu-bionic:~/workspace$ git rm assessment/ 2fatal: not a git repository (or any parent up to mount point /home/vagrant) 3Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
なお、この削除の問題に関しては、GitHub上の該当するリポジトリを削除した後だと ←2020/04/19
rm -rコマンドでうまくいきました。
再び同じ状況になったのですが、今度はリポジトリを削除した後でもディレクトリの削除ができませんでした。。。 ←2020/04/19
PCを再起動後に、GitHub上の該当するリポジトリを削除した後だとなぜか
rm -rコマンドでうまくいきました。 ←2020/04/20
補足
教材とは関係なく個人的にVSCodeでwslを使っています。
そちらの方ではすべてうまくいきました。
また、公開鍵などの設定に関しましては、教材の通りですし、
ubuntu,wslともに同じ方法で設定したはずです。
初めてのこのサイトでの質問ですので拙いところがあると思いますが、
どうかご回答よろしくお願いします。
もし根本的な解決の方法が分かった方がいましたらコメントお願いします。
解決からの逃げ道...
根本的な解決ではないのですが、
Virtual Box側のディレクトリとWindows側のフォルダを共有できるようにしているため
WindowsからUbuntuのディレクトリをいじれます。
それを利用してgit cloneのできるwsl側からUbuntuの該当ディレクトリ内に
cloneすることで、この問題の根本的な部分をいったん無視しようとします。
wsl
1/vagrant/ubntu64_18/workspace$ git clone git@github.com:yosse95ai/assessment.git 2Cloning into 'assessment'... 3Warning: Permanently added the RSA host key for IP address '13.114.40.48' to the list of known hosts.remote: Enumerating objects: 1, done. 4remote: Counting objects: 100% (1/1), done. 5remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 8 6Receiving objects: 100% (9/9), 4.13 KiB | 705.00 KiB/s, done. 7 8/vagrant/ubntu64_18/workspace$ ls assessment/ 9LICENSE README.md assessment.css assessment.html assessment.js
ひとまずはこれで作業を進めていこうと思います。
回答1件
あなたの回答
tips
プレビュー