checkout@v2 doesn't allow `git diff origin/master`
See original GitHub issueHi, I have such a step in my actions config:
name: Get list of changed files
id: changed_files
run: |
list=`git diff --name-only origin/master HEAD`
echo $list
echo "::set-output name=list::$list"
shell: bash
When using checkout@v1
it works, while with checkout@v2
I get
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
git - master branch and 'origin/master' have diverged, how to ...
I need a fresh copy from the remote instance. git checkout --track origin/master & you're done; now you can delete the placeholder-branch using...
Read more >Repositories and Branches - Git - user-manual Documentation
The git checkout command normally expects a branch head, but will also accept an arbitrary commit; for example, you can check out the...
Read more >Don't checkout master locally - Medium
Easy — git already allows you to refer to remote branches directly, via remote tracking branches, like origin/master . Need to do a...
Read more >Git Diff | Atlassian Git Tutorial
If we execute git diff at this point, there will be no output. This is expected behavior as there are no changes in...
Read more >Introducing new Git features to Visual Studio 2022
Compare your checked out branch with any local or remote branch. Checkout commit, Checkout the tip commit or any previous commit of remote...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ah sorry, i assumed you were a maintainer.
I don’t think it’s something we can configure; i think it’s something that the checkout action would have to do, by first making a call to the github API, to figure out the requisite fetch depth.
This worked for me:
For some actions, the diff is a rich source for data analyses. While this works, I’d love a built-in option (or default) to fetch the current PR’s history.