nushell
nushell copied to clipboard
Cannot execute git command to checkout a pull request
Describe the bug
Running git fetch origin pull/92/head:0.6 on bash shell runs the command successfully, fetching a pull request and storing it in the branch called 0.6 in the command. However, nushell is unable to do this, I have tried adding quotes.
How to reproduce
Run git fetch origin pull/92/head:0.6 on nu shell
Expected behavior
❯ git fetch origin pull/92/head:0.6
Error: nu::parser::extra_positional (link)
× Extra positional argument.
╭─[entry #25:1:1]
1 │ git fetch origin pull/92/head:0.6
· ────────┬───────
· ╰── extra positional argument
╰────
help: Usage: git fetch {flags} (repository)
Screenshots
No response
Configuration
No response
Additional context
No response
I've seen this many times. I wouldn't be surprised if there was another issue. I'm pretty sure it has to do with the custom completions not accommodating all parameters. I typically put a ^ in front when this happens and it fixes the problem. Long term, the git custom completions need to be updated.
This is because git fetch is being considered as internal command, if you check out config nu from terminal, you should see a custom command extern "git fetch", please try to remove it and it should do the magic
git push --force-with-lease also fails due to the same problem.
Yup, every sub command or parameter that isn't implemented in the nushell custom completions will exhibit this same error.