Replies: 2 comments
|
Check: git config --get branch.$(git branch --show-current).mergeIf you see gh pr view 456 --web
# or
git config --unset branch.$(git branch --show-current).merge
gh pr view --webTo open the newest open PR for this branch by head name: gh pr list --head "$(git branch --show-current)" --state open --limit 1 \
--json number --jq '.[0].number' | xargs -I{} gh pr view {} --webWhen lookup is by branch (no Checked |
|
After you merge PR #1 and open PR #2 from the same branch, Fix: always pass the PR number or URL# List open PRs for current branch
gh pr list --head "$(git branch --show-current)" --state open
# View the newest open PR explicitly
gh pr view 123 --webOr in one shot: gh pr view "$(gh pr list --head "$(git branch --show-current)" --state open --json number --jq '.[0].number')" --webRecommended workflow after mergingIf you reuse a branch name after merge: git checkout main
git pull
git checkout -b feature/my-change-v2 # fresh branch avoids confusion
# ... commits ...
gh pr create
gh pr view --web # now points at the new open PRWhy this happens
Hope that helps — the explicit |
Uh oh!
There was an error while loading. Please reload this page.
I created a pull request from a branch, merged it and created a new pull request from the same branch using cli. When I do
gh pr view --web, it directs me to the old PR. Ideally, I would like it to direct me to the newly created pull request.All reactions