fatal: ambiguous argument 'origin': unknown revision or path not in the working tree

后端 未结 6 2037
伪装坚强ぢ
伪装坚强ぢ 2020-12-14 05:34

I used git diff origin often in the past.

In a different environment it does not work. I have no clue why.

user@host> git diff origin         


        
6条回答
  •  萌比男神i
    2020-12-14 06:28

    For those experiencing this error on CI/CD, adding the line below worked for me on my GitHub Actions CI/CD workflow right after running pip install pyflakes diff-cover:

    git fetch origin master:refs/remotes/origin/master

    This is a snippet of the solution from the diff-cover github repo:

    Solution: diff-cover matches source files in the coverage XML report with source files in the git diff. For this reason, it's important that the relative paths to the files match. If you are using coverage.py to generate the coverage XML report, then make sure you run diff-cover from the same working directory.

    I got the solution on the links below. It is a documented diff-cover error.

    https://diff-cover.readthedocs.io/en/latest//README.html https://github.com/Bachmann1234/diff_cover/blob/master/README.rst

    Hope this helps :-).

提交回复
热议问题