I keep accidentally making changes to files in my "live" branch instead of my "work" branch.
So following the advice at Prevent commits in master branch, I added a commit stopper to the pre-commit hook. So now I can only merge into the live branch, never commit. (which I think also means I can't merge --squash). (Wish there were a way to just say these files can't be edited. ??)
So I made a ton of changes in live, and now "live" shows lots of modified files. I have NOT made a commit since I start making changes.
So I think my strategy is to: stash all the uncommitted work: git stash -u
That clears all the changes from the live branch.
Now create a new feature branch from live: git branch -b work2
Now unstash the changes into the new branch git stash pop.
Then I'm clean to go. I can commit work2 and then merge into live.
Is that right/reasonable/righteous?