首页 > 解决方案 > 如何解决致命问题:无法从 GIT 中的远程存储库中读取?

问题描述

当我执行 make init-dev 时,我在 git clone ssh 中遇到问题

if [ ! -d "goodcommerce-hydra" ] ; then git clone "git@gitlab.com:/goodcommerce/goodcommerce-hydra.git" "goodcommerce-hydra"; cd goodcommerce-hydra && git checkout "master"; fi
Cloning into 'goodcommerce-hydra'...
ssh: Could not resolve hostname gitlab.com;c: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

但是当我执行

git clone "git@gitlab.com:/goodcommerce/goodcommerce-hydra.git" "goodcommerce-hydra"

它运作良好。

也许是 de ;c in ssh: Could not resolve hostname gitlab.com;c:

我正在使用 WINDOWS 10 专业版

标签: gitgitlabrepositoryssh-keys

解决方案


我觉得 ”;” 这里错了

应该这样做;虽然“git check”似乎不是一个正确的命令。

if [ ! -d "goodcommerce-hydra"" ]; then 
git clone "git@gitlab.com:/goodcommerce/goodcommerce-hydra.git" "goodcommerce-hydra"" && cd goodcommerce-hydra && git check 
fi

推荐阅读