7

when I modified one of my cookbook that I tried to add a cookbook dependency in berks file

cookbook name, '=0.1.0', git: 'ssh://url:xxx/cookbook', tag: '0.0.1'

and then tried to converge it which throws an error

'fatal: ambiguous argument 'master': unknown revision or path not in the working tree.use '--' to separate paths from revisions, like this:git <command> [<revision>...] -- [<file>...]'on test

I don't have much clue to explain even..but I can post my explanation as we go. I appreciate your help thank you

0

2 Answers 2

5

The error looks like you're using a non-existent reference (branch/tag). Try specifying the correct branch and tag using the branch/tag options. You can also use the commit hash directly using ref option.

Also ensure that your git URL is correct (your code does not contain the xxx.git part).

1
  • yes you are right. I used undefined tag so I received that error. giving a correct tag helped to solve this. Thanks @grumpyops
    – pandey
    May 4, 2017 at 14:01
3

I recently ran into the same error. In my case, I had rebased a branch and was attempting to push to the remote. One of the pulled commits had changed the structure of a few directories, and git refused to push after the rebase, throwing:

fatal: ambiguous argument 'path/to/scripts': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Cannot open directory /absolute/path/to/scripts: No such file or directory
error: failed to push some refs to 'git@host:repo'

I tore apart all of my git configs and could not find the cause of this anywhere. The culprit turned out to be a pre-push git hook, left over from some previous config we used to use, which included some operations on the now-defunct directory.

While this clearly wasn't the cause of the OP's issue, thought I'd post this here in case someone else gets bitten. Beware the git hooks...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.