Hi,
I am trying to obtain a diff between the current HEAD of a PR and the master branch.
I understand that checkout only fetches the latest revision of the current branch only, so
I tried the approach to fetch all branches from the README.
- uses: actions/checkout@v2
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- run: git diff master HEAD
This fails with
Run git diff master HEAD
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>...]'
##[error]Process completed with exit code 128.
Running git diff master HEAD on a local copy of the repository works fine:
git clone <repo>
git checkout pr-branch
git diff master HEAD
What am I doing wrong?
Hi,
I am trying to obtain a diff between the current HEAD of a PR and the master branch.
I understand that
checkoutonly fetches the latest revision of the current branch only, soI tried the approach to fetch all branches from the README.
This fails with
Running
git diff master HEADon a local copy of the repository works fine:What am I doing wrong?