我在让Gitlab CI/CD将新更改推送到当前存储库时遇到了问题。显然,目前还不能这样做。所以现在,我想看看它是否可以推送到其他存储库。你知道吗
这就是我要做的:
我正试图用Python来测试这一点,目前有:
os.system('mkdir temp');
os.chdir('temp');
os.system('git clone git@gitlab.com/path/Rinner.git');
os.chdir('Rinner');
os.system('echo "Hello World!" > hello.txt');
os.system('git add -A');
os.system('git commit -m "Running a test..."');
os.system('git push --force');
os.chdir('..');
os.chdir('..');
os.system('rm -rf temp');
在我的本地机器上,它运行得很好。你知道吗
在我的GitLab CI/CD工作中,我得到了以下结果。你知道吗
Cloning into 'Rinner'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
当它在GitLab CI/CD上运行时,我如何才能克服这个问题?你知道吗
您正在通过SSH克隆
git clone git@gitlab.com/path/Rinner.git
,问题是您在~/.SSH/known\u hosts中的运行程序上存储了错误的服务器指纹你也可以试试
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null git@gitlab.com
和ssh git@gitlab.com
。你会发现不同的。你知道吗您需要删除此指纹或禁用密钥检查
相关问题 更多 >
编程相关推荐