{"record":{"id":"8af42ade661f182b","repo":"mislav/hub","slug":"s-use-p-to-push-the-branch-or-f-to-skip-th","errorCode":null,"errorMessage":"%s\n(use `-p` to push the branch or `-f` to skip this check)","messagePattern":"(.+?)\n\\(use `-p` to push the branch or `-f` to skip this check\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands/pull_request.go","lineNumber":196,"sourceCode":"\t\t\t\te := fmt.Errorf(`Aborted: head branch is the same as base (\"%s\")`, base)\n\t\t\t\te = fmt.Errorf(\"%s\\n(use `-h <branch>` to specify an explicit pull request head)\", e)\n\t\t\t\tutils.Check(e)\n\t\t\t}\n\t\t}\n\t}\n\n\tforce := args.Flag.Bool(\"--force\")\n\tflagPullRequestPush := args.Flag.Bool(\"--push\")\n\n\tif head == \"\" {\n\t\tif trackedBranch == nil {\n\t\t\tutils.Check(currentBranchErr)\n\t\t\tif !force && !flagPullRequestPush {\n\t\t\t\tbranchRemote, branchMerge, err := branchTrackingInformation(currentBranch)\n\t\t\t\tif err != nil || (baseRemote != nil && branchRemote == baseRemote.Name && branchMerge.ShortName() == base) {\n\t\t\t\t\tif localRepo.RemoteForBranch(currentBranch, host.User) == nil {\n\t\t\t\t\t\terr = fmt.Errorf(\"Aborted: the current branch seems not yet pushed to a remote\")\n\t\t\t\t\t\terr = fmt.Errorf(\"%s\\n(use `-p` to push the branch or `-f` to skip this check)\", err)\n\t\t\t\t\t\tutils.Check(err)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\thead = currentBranch.ShortName()\n\t\t} else {\n\t\t\thead = trackedBranch.ShortName()\n\t\t}\n\t}\n\n\tif headRepo, err := client.Repository(headProject); err == nil {\n\t\theadProject.Owner = headRepo.Owner.Login\n\t\theadProject.Name = headRepo.Name\n\t}\n\n\tfullBase := fmt.Sprintf(\"%s:%s\", baseProject.Owner, base)\n\tfullHead := fmt.Sprintf(\"%s:%s\", headProject.Owner, head)\n","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/commands/pull_request.go#L178-L214","documentation":"The wrapped form of the 'not yet pushed to a remote' abort in pullRequest: after building the base error, hub wraps it with fmt.Errorf(\"%s\\n(use `-p` to push the branch or `-f` to skip this check)\") and calls utils.Check. This index records that wrapping error with the hint suffix.","triggerScenarios":"Exactly the same conditions as error 36 — local-only branch, no -p/-f flags — seen as the second line of the printed message.","commonSituations":"Same as 36: forgetting to push a new feature branch before opening a PR.","solutions":["git push -u origin <branch> before hub pull-request","Add -p to the hub pull-request command to auto-push","Add -f to bypass the check"],"exampleFix":"# before\nhub pull-request -m \"msg\"\n# after\nhub pull-request -m \"msg\" -p","handlingStrategy":"validation","validationCode":"branch=$(git rev-parse --abbrev-ref HEAD)\ngit ls-remote --heads origin \"$branch\" | grep -q . || { git push -u origin \"$branch\"; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Automate the push before PR creation","Recognize the hint line '-p ... -f ...' in output and choose -p in scripts"],"tags":["git","pull-request","unpushed-branch","hub-cli"],"backgroundTag":"branch-not-pushed","analyzedSha":"5c547ed804368763064e51f3990851e267e88edd","analyzedAt":"2026-09-01T03:34:15.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}