--Apply the changes patch -p1 < 0001-refactored-synchronize_one_slot.patch --Review the changes first. If okay, merge it to your patch (i.e. to previous commit-id): git add src/backend/replication/logical/slotsync.c git commit --amend