Skip to main content

One post tagged with "git-add"

View All Tags

I Have Multiple Changes But Only Want to Commit the Port Update—My Git Partial Staging Journey

· 13 min read
Mahmut Salman
Software Developer

I changed my dev server port from 5173 to 5174 across three files, but I also had other unrelated changes in those same files! 😰 I only wanted to commit the port changes. My mentor walked me through Git's partial staging features: git add -p, git stash, interactive staging, and patch mode. After some trial and error (and learning what NOT to do), I successfully committed only the port changes while keeping my other work-in-progress safe. This is professional Git workflow! 🎯