简体   繁体   English

我如何推送到 Scriptler 的 git-repo?

[英]How do i push to the git-repo of Scriptler?

From https://wiki.jenkins-ci.org/display/JENKINS/Scriptler+Plugin来自https://wiki.jenkins-ci.org/display/JENKINS/Scriptler+Plugin

Git Scriptler exposes its scripts via git. Git Scriptler 通过 git 公开其脚本。 Browse to JENKINS_URL/scriptler.git on your installation to get more info about how to access the repo via git.在您的安装中浏览到 JENKINS_URL/scriptler.git 以获取有关如何通过 git 访问 repo 的更多信息。

This allows an administrator to push/pull scripts from its workstation/IDE into Scriptler.这允许管理员将脚本从其工作站/IDE 推送/拉入 Scriptler。 If such a script is pushed the first time into scriptler, then it will parse the optional header info like this:如果这样的脚本第一次被推送到 scriptler,那么它会像这样解析可选的头信息:

I have the scriptler-plugin on my jenkins and want to push changes to it.我的 jenkins 上有 scriptler-plugin 并想对其进行更改。 Cloning/Pulling works even anonymously.克隆/拉取甚至可以匿名进行。

I have configured my username in git, but the server responeded error 403, that a push as anonymous is not allowed.我已经在 git 中配置了我的用户名,但服务器响应了错误 403,不允许匿名推送。 I'm trying to push over http.我正在尝试推送 http。

My jenkins runs on windows and i havent configured any ssh-software explicit.我的 jenkins 在 Windows 上运行,我没有明确配置任何 ssh 软件。 My own computer is windows too and i have the git client installed.我自己的电脑也是 windows 的,我安装了 git 客户端。 Additionally tortoise-git.另外乌龟-git。

I dont know what i'm doing wrong.我不知道我做错了什么。 How i have to communicate my username and password?我必须如何传达我的用户名和密码?

Just figured it out myself:刚刚自己想通了:

  • Make sure that your user has a public SSH key assigned (see https://jenkins.server/jenkins/user/username/configure )确保您的用户分配了公共 SSH 密钥(请参阅https://jenkins.server/jenkins/user/username/configure
  • Make sure that your local ssh installation has the corresponding private key for the public key (cf. ~/.ssh/id_rsa)确保您的本地 ssh 安装具有对应的公钥私钥(参见 ~/.ssh/id_rsa)
  • Don't use https, but use the ssh protocol for your git repo to push (cf. ssh://jenkins.server:34841/scriptler.git)不要使用 https,而是使用 ssh 协议为您的 git repo 推送(参见 ssh://jenkins.server:34841/scriptler.git)

Then, you are able to push the changes as usual然后,您可以像往常一样推送更改

(if checked out before) (如果之前检查过)

git push origin HEAD:refs/heads/master

(or if pushing from some other repository) (或者如果从其他存储库推送)

git push ssh://jenkins.server:34841/scriptler.git HEAD:refs/heads/master

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM