I currently work on a feature that turns out to be bigger than expected, so it's propably the best to create a branch to work on it. So I need to create a new branch from my current working directory and reset the master branch to the current HEAD so that some fixes to the production environment can be done.
Somehow this sounds like an easy task, yet I can't quite figure it out. Possibly due to my lack of sleep.
You can do a checkout and create a new branch with all local and current changes transferred over.
So, create a working branch:
git checkout -b working_branch
either commit or stash your changes
git add <files> git commit -m "message"
OR
git stash
Go back to master
git checkout master git reset HEAD
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With