Checking out multiple branches: fatal: ambiguous argument 'master': unknown revision or path not in the working tree
See original GitHub issueHi Checkout team,
I’m trying to checkout both the PR branch & master so diffs can be run on the two and only modified files are linted. This returns a fatal error because master is not recognized. I think this PR (https://github.com/actions/checkout/pull/155) addresses the issue, but I’m not sure.
Is there a way to hack around this in the meantime? Thank you!
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>...]'
Config
name: Javascript Presubmit
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install npm packages
run: npm install
- name: Lint
# Run ESLint on JS and JSX files that diff from master.
run: git diff-index --name-only master | grep -E "(.*)\.(jsx|js)$" | xargs npx eslint
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
fatal: ambiguous argument 'origin': unknown revision or path ...
I tried. Yes it works. It seems git diff origin is short for git diff master origin/master if the current branch is master...
Read more >fatal: ambiguous argument 'master': unknown revision or path ...
The error looks like you're using a non-existent reference (branch/tag). Try specifying the correct branch and tag using the branch/tag ...
Read more >unknown revision or path not in the working tree" mean? : r/git
When I try reset back to the initial commit, it works out fine. However, going beyond that, I get an error message: fatal:...
Read more >error fatal: ambiguous argument 'refs/remotes/origin/master ...
24 error: Not a valid ref: refs/remotes/origin/master fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Read more >T13293 `arc land` using git-svn fails in certain configurations
COMMAND git log 'trunk'..'master' STDOUT (empty) STDERR fatal: ambiguous argument 'trunk..master': unknown revision or path not in the working tree. Use '--' to ......
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
If you set
fetch-depth: 0
it will fetch all history for all branches and tags.Updating the readme with this PR