If you’re merging a super simple bug fix from upstream Sage, you could do it by hand, of course. For approaches that better use the power of git you could see this note about cherry picking Sage commits: