I am working on a validation software.
I keep on the master branch code that is always ready to launch tests.
So I develop the new features in other branches (dev for ex).
This is classic git workflow.
My concern is that it happens that I need to switch betwen master and dev 10 times a day because the designers ask me to check their updates.
At the moment I only know one way:
- Commit my work on dev with message “Regression required”
- Switch to master branch
- Run regression and give feedbacks
- Switch back on dev and keep on working
This is annoying because of the useless history created on dev branch.
Is there another simple way (I am a beginner) to avoid the multiple commits on dev branch?
Thank you for your help!
Before switching branches, do
git stash. This will record the current state of what you’re working on in a way that is easy to recover. When you switch back to your dev branch, dogit stash pop. This will re-apply those changes, and delete the stash so that it doesn’t stay around in your history.