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?
git diff origin/master HEAD
This works, thanks!
(Feeling a bit stupid now...)
You're very welcome ;)
How about the mindset of "We are all stupid -- but we manage to do brilliant things from time to time!" (<-- me, justifying that I do much stupider things all the time XD )
Most helpful comment
You're very welcome ;)
How about the mindset of "We are all stupid -- but we manage to do brilliant things from time to time!" (<-- me, justifying that I do much stupider things all the time XD )