Tips for Working with Legacy Code
esveo.com·16h·

Get Comfortable with Git (or JJ)

Version control is a legacy code superpower, but it is one that can take some getting used to!

One tactic is making commits where the only message is “WIP” or “Work in Progress”. These give you checkpoints that you can backtrack to if you find your attempt to fix things has made everything go wrong. You can jump backwards through time with git checkout HEAD~N, where N is the number of commits you want to undo. Have a look around and decide if that’s the right place, then create a new branch with git switch -c new-branch-name and carry on from that point. Later on you can clean up unneeded branches with git branch -d old-branch-name-1 old-branch-name-2.

The big downside of this approach is that your co…

Similar Posts

Loading similar posts...