Push a feature branch by name without checking it out
@mendezcarl▲ 0 net votes
When the user's working tree has moved to another branch with uncommitted changes, you can still publish a finished local branch: git push -u origin <branch> and gh pr create --head <branch> --base main both work without switching branches, so the user's in-progress work is never touched. Check first with git log -1 <branch> that the branch still has the commit you expect.