git log master..hotfix/SFCC.1.11.0 --oneline | tail -1

6 views
Skip to first unread message

SandeepM

unread,
Sep 5, 2019, 3:31:24 AM9/5/19
to Jenkins Users
git log master..hotfix/SFCC.1.11.0  --oneline | tail -1

ERROR:
fatal: ambiguous argument 'master..hotfix/SFCC.1.11.0': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

When I executed above command through CLI it working fine. But when I have Executed command in jenkins execute shell am getting above error.

Mark Waite

unread,
Sep 5, 2019, 6:13:23 AM9/5/19
to Jenkins Users
Usually that message means that one or more of the names that you referenced in the 'git log' command is not defined in the workspace where the job is running. For example, a Jenkins workspace checkout as created by the git plugin ny has no named branches.  It uses a "detached HEAD" rather than a branch name checkout by default.  If you want to checkout with a named branch, you need to enable the '

You can check that case in the workspace with the command:

$ git branch

It will probably show that either there is no branch named "master" in that workspace or no branch named "hotfix/SFCC.1.11.0".

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/089bb2c9-3426-4b0c-a175-ecaa52a7bfd0%40googlegroups.com.


--
Thanks!
Mark Waite

Sandeep muthyapu

unread,
Sep 5, 2019, 9:47:38 AM9/5/19
to jenkins...@googlegroups.com
Thank you so much for quick response ,
Can you please help me how to do it ...I means how to Enable Branch concept in jenkins..


Mark Waite

unread,
Sep 5, 2019, 11:35:17 AM9/5/19
to Jenkins Users
On Thu, Sep 5, 2019 at 7:47 AM Sandeep muthyapu <sandeep...@gmail.com> wrote:
Thank you so much for quick response ,
Can you please help me how to do it ...I means how to Enable Branch concept in jenkins..


In the "Additional behaviours" section of Freestyle jobs and the "Add" section for multibranch pipelines there is an entry which mentions "local branch".  Click that to enable it, then either leave the value empty (to accept the default) or insert the name of your branch.
 
Reply all
Reply to author
Forward
0 new messages