Hook

Their other posts in the index, biggest breakout first.
YOU SHOULD NEVER PUSH DIRECTLY TO THE MAIN BRANCH EVER. Even if you're building solo, even if it's just a small fix, even if nobody else is on the project. Here's the branching strategy every engineer actually uses. You've got your feature branches. That's where you build new features. One branch per feature keeps everything clean. That merges into your dev branch, your active development branch where everything lives together. Then you've got staging branch. This is your dress rehearsal. It looks exactly like production so you can catch anything weird before it goes live. Then there's the main branch. Main branch is sacred. Main branch is production. Main is what your users see. Protect it. Branch protection rules, required reviews, the works. Because at 2:00 a.m. when something breaks, and it will break, you'll be so glad you can roll back in one click instead of crying in your keyboard. Branch, PR, merge, every single time.