
Git said everything merged fine. My code was gone.
Merged a feature branch yesterday. Git said zero conflicts. Pushed to main. My entire authentication module disappeared. Three hours of code just vanished. Spent an hour thinking Git was broken. It wasn't. I was using merge wrong. What happened Working on two branches: feature/auth adding OAuth login feature/ui updating frontend Both touched app.py but different sections. Merged feature/auth first, worked fine. Then merged feature/ui . git checkout main git merge feature/ui # "Auto-merging app.py" # "Merge made by the 'recursive' strategy" Zero conflicts. Pushed it. Authentication broke immediately in production. Pulled the code. My OAuth functions were completely missing. Not commented out, not broken, just gone. The file looked like I never wrote them. Why it happened Git merged the file correctly based on the branches. Problem was feature/ui was created BEFORE I merged feature/auth . So from Git's perspective: main at time T: has basic auth feature/ui branched from T: has basic auth
Continue reading on Dev.to Tutorial
Opens in a new tab


