-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
If you have local changes and try to run gh worktree pr [num] <path> without first commiting or stashing, then you see a seemingly unrelated error message, e.g.
$ gh worktree pr 12345 /home/will/src/project-12345
fatal: invalid reference: RemoteBranchName
Error: exit status 128
Usage:
worktree pr [pr number] <path> [flags]
Flags:
-h, --help help for pr
exit status 128
Running with git shows the full issue:
$ gh pr checkout 12345
remote: Enumerating objects: 79, done.
remote: Counting objects: 100% (67/67), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 79 (delta 65), reused 65 (delta 65), pack-reused 12
Unpacking objects: 100% (79/79), 45.43 KiB | 969.00 KiB/s, done.
From https://github.com/my/project
* [new ref] refs/pull/12345/head -> RemoteBranchName
error: Your local changes to the following files would be overwritten by checkout:
src/my_file.cpp
Please commit your changes or stash them before you switch branches.
AbortingWould be neat if this plugin propagated errors a bit more fully?
Ps thanks for the plugin, really enjoy it!
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers