question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Checking out multiple branches: fatal: ambiguous argument 'master': unknown revision or path not in the working tree

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
ericsciplecommented, Jul 13, 2020

If you set fetch-depth: 0 it will fetch all history for all branches and tags.

2reactions
ericsciplecommented, Jul 13, 2020

Updating the readme with this PR

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found