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.

Leave default branchgh pr create --title --bodyURL on stdout

Same repo, two heads

mainStay on main
branchFeature branch
URLgh pr create

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

CommandHeadResult
gh pr create on default branchSame as baseNo URL — nothing to merge
gh pr create --title … --body … on a branchPushed or promptedURL — first success
gh pr create --fillFrom commitsAutofill; title/body flags still override
gh pr create --webOpens browserNot a printed URL
gh pr create --attachFiles on the PR50 files per command

First PR from the terminal

  1. 01
    Leave 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.

  2. 02
    Skip 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.

  3. 03
    Read stdout

    Upon success the URL is printed. That is the first PR. --fill uses commit info; flags still win. --draft if it must not merge yet.

  4. 04
    One attach limit

    --attach uploads 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/1

On 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.

Start the picture