{"record":{"id":"e9a9e5da62ec2383","repo":"mislav/hub","slug":"aborted-the-current-branch-seems-not-yet-pushed-t","errorCode":null,"errorMessage":"Aborted: the current branch seems not yet pushed to a remote\n(use `-p` to push the branch or `-f` to skip this check)","messagePattern":"Aborted: the current branch seems not yet pushed to a remote\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":195,"sourceCode":"\t\t\tif baseProject.SameAs(headProject) && base == trackedBranch.ShortName() {\n\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)","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/commands/pull_request.go#L177-L213","documentation":"When the current branch has no upstream (trackedBranch == nil) and neither -f (force) nor -p (push) was given, pullRequest checks whether the branch exists on any remote. If the branch was never pushed, it aborts with this message, appending the hint to use -p to push or -f to skip. This index (36) is the base 'Aborted' message path.","triggerScenarios":"Creating a pull request from a purely local branch: branchTrackingInformation fails or indicates the branch tracks the base remote/branch, and localRepo.RemoteForBranch returns nil, all without --force/--push flags.","commonSituations":"Committing on a new feature branch and immediately running hub pull-request before ever pushing; CI checkouts that create branches locally without pushing.","solutions":["Push the branch first: git push -u origin <branch>","Run hub pull-request -p to let hub push the branch before creating the PR","Use -f to skip the unpushed-branch check if you are sure the branch exists remotely"],"exampleFix":"# before\n$ git checkout -b my-feature && hub pull-request\nAborted: the current branch seems not yet pushed to a remote\n# after\n$ hub pull-request -p   # or: git push -u origin my-feature first","handlingStrategy":"validation","validationCode":"branch=$(git rev-parse --abbrev-ref HEAD)\ngit ls-remote --heads origin \"$branch\" | grep -q . || { echo \"Branch $branch not pushed; run git push -u origin $branch\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always git push -u origin <branch> right after creating it","Use hub pull-request -p in automation to auto-push","Check 'git status -sb' for missing upstream ([gone] / no tracking)"],"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"}