gh on main never prints a PR URL
On the default branch, gh pr create does not print a PR URL. First success is a feature branch plus --title and --body.
You ran gh pr create while still on main. GitHub has nothing unique to merge, so no pull URL prints. To put that split on one page, open sitdraw.
The stall is not the installer. It is treating the default branch as a pull request. Head and base are the same commits.
Same repo, two heads
Stay on main
Base is the default branch. With no unique commits, GitHub has no pull request to open. The CLI does not invent a branch.
Feature branch
After git switch -c and a commit, gh pr create --title and --body skip prompts. Success prints the URL. See the gh install note.
Which command prints a URL
| Command | Head | Result |
|---|---|---|
gh pr create on default branch | Same as base | No URL — nothing to merge |
gh pr create --title … --body … on a branch | Pushed or prompted | URL — first success |
gh pr create --fill | From commits | Autofill; title/body flags still override |
gh pr create --web | Opens browser | Not a printed URL |
gh pr create --attach | Files on the PR | 50 files per command |
First PR from the terminal
- 01Leave the default branch
Create a branch with unique commits. Stay off the merge base. If the branch is not fully pushed, gh will ask where to push, or offer a fork.
- 02Skip the title prompt
gh pr create --title "The bug is fixed" --body "Everything works again". Official example on the manual page. Alias:gh pr new. - 03Read stdout
Upon success the URL is printed. That is the first PR.
--filluses commit info; flags still win.--draftif it must not merge yet. - 04One attach limit
--attachuploads an image or video onto the body. The same manual page caps this at 50 files per command. Failed files still leave a created PR and a non-zero exit.
git switch -c fix-login-timeout
git add .
git commit -m "Fix login timeout"
# still on main? gh will not print a PR URL
gh pr create --title "The bug is fixed" --body "Everything works again"
# success prints: https://github.com/owner/repo/pull/1On the default branch, gh has nothing to merge. First success is a branch plus --title and --body, and a URL on stdout.
Keep the branch split on one canvas: read the guide, then open a space from the start of the page.
Why no URL on main?
GitHub opens a pull request only when head has unique commits versus base. The default branch is usually that base. Switch first.
Does --fill replace --title?
No. If you pass --title or --body with --fill, the flags overwrite autofill.
What is the attach limit?
Up to 50 files per gh pr create --attach. Partial upload still creates the PR and prints the URL, then exits non-zero.
Leave main first
If gh pr create prints no pull URL, you are still on the merge base. Switch, then pass --title and --body.