首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Jenkins配置本地git

用Jenkins配置本地git
EN

Stack Overflow用户
提问于 2017-06-20 08:25:58
回答 1查看 770关注 0票数 0

在我们的组织中,我们有本地托管的git。对于我的项目,我需要在jenkins的帮助下实现CI。我知道用GitHub配置jenkins,但不确定用本地git配置它。

Repository URL中,我应该提供什么?

运行git remote show origin

在我的存储库中,我得到了如下所示的命令

代码语言:javascript
复制
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命令,输出如下

代码语言:javascript
复制
origin  gitbox:OPT (fetch)
origin  gitbox:OPT (push)

我试图将Repository URL命名为gitbox:OPT,但当我输入gitbox:OPT时,詹金斯给出了下面的错误

代码语言:javascript
复制
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中提供什么吗?

EN

回答 1

Stack Overflow用户

发布于 2017-06-20 09:01:50

简单:当给定别名时,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,如下所示

代码语言:javascript
复制
gitolite-admin RW+ = gitolite 
repo testing 
  RW+ = @all 
repo bigfastblog 
  RW+ = anish 

确保将该gitolite.conf推回Ubuntu服务器,并检查~gitolite/.ssh/authorized_keys确实列出了anish.pub内容。

另外,HOME/.ssh应该包括anish.pubanish (私钥)

最后能够克隆:这是HOME环境变量的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44647694

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档