This is a great idea! This functionality should probably be included within git.
One idea that comes to my mind how you could complicate this (read: make it work "completely"). You could extend the script to open all the staged files and add a comment to the top of the file. Something like: --staged--. Then, when you "unwip", it can read that comment and stage/unstage files as needed, while also removing that comment.
If you do a git stash -u, it will create a commit for you that includes staged, unstaged and untracked files, and it knows which files were staged and which ones weren't. If you wanted to keep the changes that were stashed as they were, you can issue a git stash apply immediately after (use apply to keep the stash, or pop to discard it after applying it).
Git never seizes to amaze me for its unlimited functionality.
For applying the stash, you need add --index as in: git stash apply --index. This will restore the index (staged/unstaged files) along with the file changes.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is a great idea! This functionality should probably be included within git.
One idea that comes to my mind how you could complicate this (read: make it work "completely"). You could extend the script to open all the staged files and add a comment to the top of the file. Something like:
--staged--
. Then, when you "unwip", it can read that comment and stage/unstage files as needed, while also removing that comment.It already is, in a way.
If you do a
git stash -u
, it will create a commit for you that includes staged, unstaged and untracked files, and it knows which files were staged and which ones weren't. If you wanted to keep the changes that were stashed as they were, you can issue agit stash apply
immediately after (useapply
to keep the stash, orpop
to discard it after applying it).This is amazing! Thank you!
Git never seizes to amaze me for its unlimited functionality.
For applying the stash, you need add
--index
as in:git stash apply --index
. This will restore the index (staged/unstaged files) along with the file changes.