日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

玩转GIT系列之【git submodule update出错提示子模组未对路径注册】

發布時間:2023/12/15 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 玩转GIT系列之【git submodule update出错提示子模组未对路径注册】 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

今天在github上找到了一個很有意思的項目,叫做listen1【https://github.com/listen1】,它是一個開源的項目,可以從各大音樂網站自動化搜索歌曲、避免某個特定的網站因為版權問題而無法聽歌,超級實用(這里先給作者點個贊,打個小廣告)。下面摘自作者的原文:

當我發現找個想聽的歌因為版權聽不了,需要打開好幾個網站開始搜索,來回切換讓我抓狂的時候,我知道是時候該做點什么了。
媽媽再也不用擔心我找不到我想聽的歌了。這里包含了網易云音樂,蝦米,QQ音樂, 酷狗音樂,酷我音樂的曲庫,夠全夠大了吧。
搜歌,聽歌,就用 Listen1。

于是嘗試將它的源碼clone下來學習學習??墒莄lone下來之后,看到一個提示信息,說:

項目中包含了listen1_chrome_extension的引用,在checkout后需要把引用庫初始化
git submodule update --init --recursive

于是,執行。

可是,出錯:

leon@Ubuntu:~/studytest/listen1_desktop$ git submodule update --init --recursive 子模組 'app/listen1_chrome_extension' (git@github.com:listen1/listen1_chrome_extension.git) 未對路徑 'app/listen1_chrome_extension' 注冊 正克隆到 'app/listen1_chrome_extension'... The authenticity of host 'github.com (52.74.223.119)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,52.74.223.119' (RSA) to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists. fatal: 無法克隆 'git@github.com:listen1/listen1_chrome_extension.git' 到子模組路徑 'app/listen1_chrome_extension'

于是開始百度“git submodule”相關的各類博文,卻始終沒有發現一個對路的解決辦法,大多數人都是拷貝、復制、黏貼、轉發別人的博文,沒有什么參考意義。

終于,歷經千辛萬苦(略有夸張哈哈),在一位大神的博客里找到了成功的解決方案:

因為我使用的git url格式與原項目下的.gitmodule文件中的url格式不對,它寫的是git格式,而我使用的是https的格式

按照以下方法更換一下即可:

vi .gitmodules

將下面的原文:

[submodule "app/listen1_chrome_extension"]path = app/listen1_chrome_extensionurl = git@github.com:listen1/listen1_chrome_extension.git

修改成:

[submodule "app/listen1_chrome_extension"]path = app/listen1_chrome_extensionurl = https://github.com/listen1/listen1_chrome_extension.git

修改完后,再次執行:

leon@Ubuntu:~/studytest/listen1_desktop$ git submodule update --init --recursive 正克隆到 'app/listen1_chrome_extension'... Permission denied (publickey). fatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists. fatal: 無法克隆 'git@github.com:listen1/listen1_chrome_extension.git' 到子模組路徑 'app/listen1_chrome_extension'

腫么還是出錯!!!!????

淡定淡定,再來分析。原來是子模塊的url沒有同步修改,于是執行下面的命令:

leon@Ubuntu:~/studytest/listen1_desktop$ git submodule sync'app/listen1_chrome_extension' 同步子模組 url

最后再來:

leon@Ubuntu:~/studytest/listen1_desktop$ git submodule update --init --recursive 正克隆到 'app/listen1_chrome_extension'... remote: Enumerating objects: 45, done. remote: Counting objects: 100% (45/45), done. remote: Compressing objects: 100% (34/34), done. remote: Total 899 (delta 20), reused 24 (delta 11), pack-reused 854 接收對象中: 100% (899/899), 1.00 MiB | 322.00 KiB/s, 完成. 處理 delta 中: 100% (587/587), 完成. 檢查連接... 完成。 子模組路徑 'app/listen1_chrome_extension':檢出 '0af87e6b028a1ac2f544b74aca1824b2cef66880'

終于成功了!!!

總結

以上是生活随笔為你收集整理的玩转GIT系列之【git submodule update出错提示子模组未对路径注册】的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。