推送/提交Jenkins git插件:#不在任何分支(GitHub回购) [英] Pushing/committing with the Jenkins git plugin: #Not on any branch (GitHub repo)
问题描述
我正在使用Jenkins的 Git Plugin ,并且有一个Job需要承诺并推动一些变化。我使用的git存储库托管在GitHub上。然而,当我运行 git status
或<$ c时,我对git有点新鲜感。
#不在任何分支上
。如果我告诉插件使用'分支说明符',即 origin / master
,这没有帮助。 我该如何让插件的行为像我在桌面上完成 git clone
?
你可能运行了 git checkout< some-sha>
,所以现在 git
正在看着那个提交,但不在任何分支的顶端。
如果您已经完成了现在的工作,请使用 git diff> savefile.tmp
然后签出你想要的分支: git checkout master
,
然后应用您所做的工作: patch -p1< savefile.tmp
,
修复所有冲突,并且 git commit
您的工作。
然后您可以 git push
。
如果您的工作没有完成,您只需签出并掌握即可。
I am using the Git Plugin of Jenkins and have a Job that needs to commit and push some changes. The git repository I am using is hosted on GitHub. Bear with me, I am somewhat new to git.
However, when I run git status
or git commit
it says # Not on any branch
. If I tell the plugin to use a 'branch specifier', i.e. origin/master
this doesn't help.
Ho do I get the plugin to behave as if I would have done git clone
on my desktop?
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.
If you've done work where you are now, save it with git diff > savefile.tmp
and then checkout to the branch you want: git checkout master
,
and then apply the work you've done: patch -p1 < savefile.tmp
,
fix any conflicts, and git commit
your work.
Then you can git push
.
If no work is done where you stand, then just checkout to master and push.
这篇关于推送/提交Jenkins git插件:#不在任何分支(GitHub回购)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!