Support gitfile-based repositories in gh repo create --source .
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Reproduce the failure with gh repo create repo-name123 --private --push --source . --remote origin in a repository whose .git is a gitfile, then trace the repository-detection entry point used by gh repo create. Done means the command recognizes the working tree as a Git repository and no longer reports that git init is required.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 46.3k
- Forks
- 9.1k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 73
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cli/cli
-
more-info-needed needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
bug gh-pr priority-2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug gh-pr priority-2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug gh-auth priority-3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement gh-issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100