3 ms·
The logic you're suggesting can easily be implemented with a Git hook: https://stackoverflow.com/questions/40462111/prevent-commits-in-master-branch https://st
by djur 3y ago
The logic you're suggesting can easily be implemented with a Git hook:
https://stackoverflow.com/questions/40462111/prevent-commits-in-master-branch https://stackoverflow.com/questions/40462111/prevent-commits...
Alternately, you can simply not check out that branch locally at all, and then you'll never have to worry about accidentally committing to it.
- WorldMaker 3y agoAlso, many repo hosts have branch protection tools, and VS Code has a setting git.branchProtection to list branches which you want VS Code to remind you not to commit to, which can be handy.