-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Currently, trying to start a new branch while having unstaged changes works like this:
$ git-cd start my-fancy-new-branch
git-cd start
Executing: git checkout main
D some/file/i/deleted.js
M some/modified/file.php
A some/new/file.md
Your branch is up to date with 'origin/main'.
Executing: git pull origin main
Error:
error: cannot pull with rebase: You have unstaged changes.
error: additionally, your index contains uncommitted changes.
error: please commit or stash them.Ideally, it would work like this:
$ git-cd start my-fancy-new-branch
git-cd start
Checking if there are unstaged files...
Whoops, you got some unstaged files! Should I stash them and then re-apply them after [y/N]?
$ yes please, thank you
Executing: git stash
Executing: git checkout main
Executing: git pull origin main
Executing: git checkout -b my-fancy-new-branch
Executing: git push origin my-fancy-new-branch
Executing: git branch --set-upstream-to origin/my-fancy-new-branch
Executing: git stash popMy current workaround is to enter git stash && git-cd start my-fancy-new-branch && git stash pop
Metadata
Metadata
Assignees
Labels
No labels