在我们的组织中,我们有本地托管的git。对于我的项目,我需要在jenkins的帮助下实现CI。我知道用GitHub配置jenkins但不确定用本地git配置它。
在Repository URL
我应该提供什么?
git remote show origin
后在我的存储库中的
命令我有类似下面的内容
WARNING: previous mirror push of repo 'OPT' to host 'tregit1' failed, status is:
2017-06-16.19:28:39 31417 ssh: connect to host 10.9.100.31 port 22: No route to host
2017-06-16.19:28:39 31417 fatal: Could not read from remote repository.
2017-06-16.19:28:39 31417
2017-06-16.19:28:39 31417 Please make sure you have the correct access rights
2017-06-16.19:28:39 31417 and the repository exists.
----------
* remote origin
Fetch URL: gitbox:OPT
Push URL: gitbox:OPT
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
并且为了运行这个git remote -v
命令,输出就像
origin gitbox:OPT (fetch)
origin gitbox:OPT (push)
我尝试将Repository URL
作为gitbox:OPT
,但一旦我输入gitbox:OPT
Failed to connect to repository : Command "git ls-remote -h gitbox:OPT HEAD"
returned status code 128:
stdout:
stderr: ssh: Could not resolve hostname gitbox: Temporary failure in name resolution
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
并且存储库存在。
任何人都可以告诉我在Git URL中提供什么吗?
答案 0 :(得分:0)
简单:当给定别名时,ssh将查找%HOME%/.ssg/config
。
与“config
”相同,而不是“conf
”。
确保HOME
已定义(C:\Users\AY
)。并且您的ssh配置文件名为“config
”。
同时测试ssh -i C:\Users\AY\.ssh\anish -T gitolite@10.47.52.185
是否有效。
我使用了ubuntu中的
gitolite.pub
,我在windows中创建了anish.pub
并将其添加到gitolite并更改了conf/gitolite.conf
,如下所示repo
gitolite-admin RW+ = gitolite
repo testing
RW+ = @all
repo bigfastblog
RW+ = anish
确保将gitolite.conf推送回Ubuntu服务器,并检查~gitolite/.ssh/authorized_keys
是否列出anish.pub
内容。
此外,Windows HOME/.ssh
应包含anish.pub
和anish
(私钥)
最终能够克隆:
HOME
环境变量存在问题。