Fetch origin/main, rebase current branch, resolve conflicts safely, then commit and push changes; create a PR if none exists for the branch.
Safely sync a working branch with origin/main, handle rebase conflicts, then publish and open a PR if needed.
Inspect branch and working tree
git branch --show-currentgit status --shortFetch and rebase onto main
git fetch origin maingit rebase origin/mainResolve rebase conflicts (if any)
git status --shortgit add <paths> or git rm <paths>.git rebase --continue.Commit user-requested local changes (only if needed)
git status --short is empty, skip commit.git add -A by default), then commit with a conventional message.Push branch
git pushgit push --force-with-lease only when user explicitly asked for rewritten-history push.Ensure a PR exists
gh pr list --head "$(git branch --show-current)" --json number,title,state,urlgh pr create --fill--fill fails due to missing metadata, provide explicit --title and --body.Report result
git reset --hard, git checkout --, or force push without explicit user approval.