[英]Unable to do git push from jenkins when creating a new branch
I am creating a new git branch from Jenkins (execute shell) using the below commands but when I run this job, it creates the branch locally but doesn't push it to the origin.我正在使用以下命令从 Jenkins(执行 shell)创建一个新的 git 分支,但是当我运行此作业时,它会在本地创建分支但不会将其推送到原点。 Also this Jenkins job just stuck at the git-push command and never completes.
此外,这个 Jenkins 作业只是卡在 git-push 命令上并且永远不会完成。 I think I am missing something somewhere due to which it is not able to push.
我想我在某个地方遗漏了一些东西,因为它无法推动。
git fetch origin old-branch:new-branch git checkout new-branch git push -u origin new-branch git fetch origin old-branch:new-branch git checkout new-branch git push -u origin new-branch
Did I missed anything?我错过了什么吗? Any suggestions?
有什么建议么?
The commands you have mentioned are correct and there seems to be no issue in that.您提到的命令是正确的,似乎没有问题。
git fetch origin master:newbranch
git checkout newbranch
git push -u origin newbranch
In this particular order.按照这个特定的顺序。
Please check is the user with which Jenkins jobs are running has sufficient privileges to create branch in the git repository.请检查运行 Jenkins 作业的用户是否有足够的权限在 git 存储库中创建分支。
And by stuck what do you mean, does it timeout or gives any error.卡住是什么意思,它是超时还是给出任何错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.