Describe the bug
gh repo create --source . fails to detect a Git repository when the working tree uses a gitfile (.git file pointing to the actual Git directory) instead of a .git directory.
Affected version
gh version 2.92.0 (2026-04-28)
Steps to reproduce the behavior
- Create a Git repository that uses a gitfile (.git is a file containing gitdir: ...).
- Run:
gh repo create repo-name123 --private --push --source . --remote origin
- Observe the error:
current directory is not a git repository. Run 'git init' to initialize it
Expected vs actual behavior
Expected: gh should recognize repositories that use a gitfile, the same way Git does.
Actual: gh reports that the current directory is not a Git repository.
Describe the bug
gh repo create --source . fails to detect a Git repository when the working tree uses a gitfile (.git file pointing to the actual Git directory) instead of a .git directory.
Affected version
gh version 2.92.0 (2026-04-28)
Steps to reproduce the behavior
gh repo create repo-name123 --private --push --source . --remote origin
current directory is not a git repository. Run 'git init' to initialize it
Expected vs actual behavior
Expected: gh should recognize repositories that use a gitfile, the same way Git does.
Actual: gh reports that the current directory is not a Git repository.