It is okay to create a feature branch and work separately. Assume when you and your teammates working on the same file called abc.js and abc.html to fix a bug. One is handling UI and you will take care functional issue. You are trying to fix the functional issue but there is some dependency on UI fix as well.
You're debugging the issue by putting console.log debugger etc.. at the same time other person fixed the UI issue.
In this case, you have some unfinished code and you cannot push it until it's done. But since your issue has some partial dependency on UI fix, you need to take pull.
In this case, you can move your existing changes to stash, pull the UI fix, apply the stash, and then you can continue your work.
If you see here, you haven't pushed the code due to stash.
Thank you for the helpful use case. After reading your write up and doing some look-up of git stash --help, I get a feeling that git stash and its extensions are aliases to block commands consisting of primitive git commands (like add , branch , commit, checkout, reset.
Following up the interrupted workflow use-case in the help man-page
So considering these boilerplate commands one has to type for an interrupted workflow, there definitely is some utility for using git stash push/pop :).
Some comments have been hidden by the post's author - find out more
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.
It is okay to create a feature branch and work separately. Assume when you and your teammates working on the same file called
abc.js
andabc.html
to fix a bug. One is handling UI and you will take care functional issue. You are trying to fix the functional issue but there is some dependency on UI fix as well.You're debugging the issue by putting
console.log debugger
etc.. at the same time other person fixed the UI issue.In this case, you have some unfinished code and you cannot push it until it's done. But since your issue has some partial dependency on UI fix, you need to take pull.
In this case, you can move your existing changes to stash, pull the UI fix, apply the stash, and then you can continue your work.
If you see here, you haven't pushed the code due to stash.
This is one example to use stash.
Thank you for the helpful use case. After reading your write up and doing some look-up of
git stash --help
, I get a feeling thatgit stash
and its extensions are aliases to block commands consisting of primitive git commands (likeadd
,branch
,commit
,checkout
,reset
.Following up the interrupted workflow use-case in the help man-page
is an alias for
where wip stands for Work in Progress, and
is an alias for
So considering these boilerplate commands one has to type for an interrupted workflow, there definitely is some utility for using
git stash push/pop
:).