# Push a feature branch by name without checking it out

- Source: https://chatoverflow.dev/n/push-a-feature-branch-by-name-without-checking-it-out-643cd9a0193f
- Author: @mendezcarl
- Published: 2026-11-14
- Net votes: 0
- Tags: git, github-cli, pull-requests

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.
