mislav/hub · error
%s\n(use `-f` to force submit a pull request anyway)
Error message
%s\n(use `-f` to force submit a pull request anyway)
What it means
The wrapped second error of the unpushed-commits abort: hub wraps the 'Aborted: %d commits are not yet pushed to %s' error with the hint line "(use `-f` to force submit a pull request anyway)" and passes it to utils.Check, so the printed message ends with this guidance.
Source
Thrown at commands/pull_request.go:219
head = currentBranch.ShortName()
} else {
head = trackedBranch.ShortName()
}
}
if headRepo, err := client.Repository(headProject); err == nil {
headProject.Owner = headRepo.Owner.Login
headProject.Name = headRepo.Name
}
fullBase := fmt.Sprintf("%s:%s", baseProject.Owner, base)
fullHead := fmt.Sprintf("%s:%s", headProject.Owner, head)
if !force && trackedBranch != nil {
remoteCommits, err := git.RefList(trackedBranch.LongName(), "")
if err == nil && len(remoteCommits) > 0 {
err = fmt.Errorf("Aborted: %d commits are not yet pushed to %s", len(remoteCommits), trackedBranch.LongName())
err = fmt.Errorf("%s\n(use `-f` to force submit a pull request anyway)", err)
utils.Check(err)
}
}
messageBuilder := &github.MessageBuilder{
Filename: "PULLREQ_EDITMSG",
Title: "pull request",
}
baseTracking := base
headTracking := head
remote := baseRemote
if remote != nil {
baseTracking = fmt.Sprintf("%s/%s", remote.Name, base)
}
if remote == nil || !baseProject.SameAs(headProject) {
remote, _ = localRepo.RemoteForProject(headProject)View on GitHub (pinned to 5c547ed804)
Solutions
- git push to publish the pending commits, then retry
- Use hub pull-request -f to force submit regardless
- Add a pre-submit check (git cherry / git log @{u}..HEAD) in scripts before calling hub
Example fix
# before hub pull-request -m "msg" # aborts with N commits not pushed # after git push && hub pull-request -m "msg"
Defensive patterns
Strategy: validation
Validate before calling
[ -z "$(git rev-list @{u}..HEAD 2>/dev/null)" ] || git push Prevention
- Same as the base error: ensure the branch is fully pushed before hub pull-request
- Avoid amending pushed commits without pushing again
- Prefer pushing over using -f so reviewers see all commits
When it happens
Trigger: Same as error 38 — trackedBranch exists, git.RefList(trackedBranch.LongName(), "") returns at least one commit, and no -f flag — producing the multi-line message ending in this hint.
Common situations: Same as 38: local commits ahead of the upstream at PR-creation time, commonly after amending a pushed commit or forgetting a final push.
Related errors
- Aborted: %d commits are not yet pushed to %s (use `-f` to fo
- could not determine project for head branch
- Aborted: head branch is the same as base ("%s") (use `-h <br
- %s (use `-h <branch>` to specify an explicit pull request he
- Aborted: the current branch seems not yet pushed to a remote
AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01).
Data as JSON: /api/errors/650cfc29f39002bb.
Report an issue: GitHub.