I am a Developer Advocate for Security in Mobile Apps and APIs at approov.io.
Another passion is the Elixir programming language that was designed to be concurrent, distributed and fault tolerant.
Location
Scotland
Education
Self teached Developer
Work
Developer Advocate for Mobile and API Security at approov.io
The gwip commits everything with the message --wip-- [skip ci]. By everything I mean untracked files, changes not staged for commit, and changes already staged for commit.
The gunwip reverts gwip, with the caveat that changes already staged for commit will become changes not staged for commit.
I use it to save my work until I am ready to create a proper commit.
Having [skip ci] in the commit message tell the Continuous Integration pipeline to ignore the commit.
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.
Awesome article... congrats :)
My favourite and most used Git alias:
The
gwip
commits everything with the message--wip-- [skip ci]
. By everything I mean untracked files, changes not staged for commit, and changes already staged for commit.The
gunwip
revertsgwip
, with the caveat that changes already staged for commit will become changes not staged for commit.I use it to save my work until I am ready to create a proper commit.
Having
[skip ci]
in the commit message tell the Continuous Integration pipeline to ignore the commit.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.