-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
Describe the bug
When attempting to create a PR targeting a repository with --repo, the PR creation fails and the gh cli reports:
fatal: not a git repository (or any of the parent directories): .git
❯ gh --version
gh version 2.4.0 (2021-12-21)
https://github.com/cli/cli/releases/tag/v2.4.0
❯ gh auth status
github.com
✓ Logged in to github.com as gilzow (/Users/gilzow/.config/gh/hosts.yml)
✓ Git operations for github.com configured to use ssh protocol.
✓ Token: *******************I also did gh auth refresh just to make sure there wasn't something wrong with my token.
Steps to reproduce the behavior
- cd into a directory that does not contain a repository
- issue the
create prcommand targeting a specific repository with the--repoparameter:
gh pr create --head "update" --base "master" --title "title" --body "body" --repo gilzow/wordpress-composerThe repository gilzow/wordpress-composer exists
Its default branch is master
It has a branch update that is ahead of master and is eligible to be merged
- See error:
fatal: not a git repository (or any of the parent directories): .git
/usr/bin/git: exit status 128Expected vs actual behavior
A PR should be created and a URL to the PR should be reported back.
I've tried this with several of my repositories and all exhibit the same behavior. If however, I cd into a local clone of the repository locally and issue the same command, it creates the PR as expected. However, this is being used as part of a larger automation where a local clone of the repository will not be present.
Logs
Is there a verbose or debug parameter to output additional information? If so, please let me know and I'll update this issue with the additional logs.