When I work, I often meet with this workflow:
- Doing something.
- Someone comes to my desk and ask something, I must move to another branch for checking.
- I commit code on this current branch and checkout another branch.
- When I finish, I checkout old branch and continue to work.
This workflow has a disadvantage: it generates a dummy commit in my system. My question is: how can I avoid this situation? For example, when I come back to work, I will cancel previous commit?