What would you recommend to help developers become more comfortable deleting dead code (as opposed to commenting it out) with the confidence they could find it later in source control?
Commented code is dead code - REMOVE IT! Let Git do its job.
But yes, I recommend doing it as a separate commit with a clear commit message on what code was deleted so you have the best chance of finding it again.
However, from my experience, it's rare you'll actually look for code this way. Most people just go back to a known point in history to see old code instead of trying to pinpoint the exact commit.
We’re a place for programmers to stay up-to-date, learn new skills, and share ideas.
We’ll never post without your permission.