V
14

Update: My code went sideways at a hackathon near Denver last weekend

I was at this 24-hour hackathon in Denver last Saturday, trying to push a simple feature to GitHub, and suddenly the entire repo crashed because I forgot to check my branch merge settings. Nobody warned me that beginners like me could mess up a shared project so fast just by hitting the wrong command. Has anyone else had a similar disaster at a coding event, and how do you avoid this kind of panic mid-project?
3 comments

Log in to join the discussion

Log In
3 Comments
shanec61
shanec618h ago
Man, that sounds rough! A crashed repo at a hackathon is a nightmare, especially when you're running on no sleep. I had a similar thing happen at a meetup where I accidentally force pushed to the main branch instead of my own fork. The whole team's work just vanished for a few minutes until someone with admin rights rolled it back. What saved me later was setting up a simple rule with the team to always do a pull request and never push directly to main. Also, using a tool like Git Kraken or even just the command line with a dry run option can help you double check before you hit enter. Keep backups of your local work if you can, just in case the remote goes sideways.
4
emmaking
emmaking8h ago
Force pushed to main instead of your own fork" oh man that hits close to home. I did the exact same thing at a Denver hackathon last year. Now I just set the main branch as protected in the repo settings before we even start coding, and I always do a "git status" like five times before pushing anything.
4
casey818
casey8183h ago
Read somewhere that git reflog saves your bacon in those moments.
1