简体   繁体   English

推送/提交Jenkins git插件:#Not在任何分支上(GitHub repo)

[英]Pushing/committing with the Jenkins git plugin: #Not on any branch (GitHub repo)

I am using the Git Plugin of Jenkins and have a Job that needs to commit and push some changes. 我正在使用Jenkins的Git插件并且有一个需要提交并推动一些更改的Job。 The git repository I am using is hosted on GitHub. 我正在使用的git存储库托管在GitHub上。 Bear with me, I am somewhat new to git. 忍受我,我对git有些新意。

However, when I run git status or git commit it says # Not on any branch . 但是,当我运行git statusgit commit它会# Not on any branch If I tell the plugin to use a 'branch specifier', ie origin/master this doesn't help. 如果我告诉插件使用'分支说明符',即origin/master这没有帮助。

Ho do I get the plugin to behave as if I would have done git clone on my desktop? 我可以让插件表现得好像我会在桌面上完成git clone吗?

you have run git checkout <some-sha> probably, so now git is looking at that commit, but is not on the tip of any branch. 你可能已经运行了git checkout <some-sha> ,所以现在git正在查看该提交,但不在任何分支的提示上。

If you've done work where you are now, save it with git diff > savefile.tmp 如果您已经完成了现在的工作,请使用git diff > savefile.tmp保存
and then checkout to the branch you want: git checkout master , 然后结账到你想要的分行: git checkout master
and then apply the work you've done: patch -p1 < savefile.tmp , 然后应用你已经完成的工作: patch -p1 < savefile.tmp
fix any conflicts, and git commit your work. 修复任何冲突, git commit你的工作。
Then you can git push . 然后你可以git push

If no work is done where you stand, then just checkout to master and push. 如果您没有完成任何工作,那么只需要结帐并掌握并推送。

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

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