From 95b93db2f16a743c089aa7d749b35f61a55d1802 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 14 May 2024 22:23:31 +0100 Subject: [PATCH] Add daily email for 2024-05-10 Optimise for revertability --- source/_daily_emails/2024-05-10.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 source/_daily_emails/2024-05-10.md diff --git a/source/_daily_emails/2024-05-10.md b/source/_daily_emails/2024-05-10.md new file mode 100644 index 00000000..1162c63c --- /dev/null +++ b/source/_daily_emails/2024-05-10.md @@ -0,0 +1,25 @@ +--- +title: Optimise for revertability +date: 2024-05-10 +permalink: archive/2024/05/10/optimise-for-revertability +tags: + - software-development + - git +cta: ~ +snippet: | + If you needed to revert a commit in a codebase, could you do so easily? +--- + +There are two things I avoid when merging changes in Git. + +Merge commits and squashing commits. + +Both make it hard to revert changes if needed once they've been merged, such as a major bug in production and you quickly need to roll back. + +Merge commits are difficult to revert and if a commit has been squashed into one larger commit, you can't revert it without also reverting everything else. + +Working with small, unsquashed commits makes it simple to revert a specific one and only that one. + +If I need to revert something, I want to be able to do as simply and specifically as possible. + +Optimise for revertability.