Create and apply a git patch
# Create a diff file: git diff base_ref_or_branch compare_ref_or_branch > file.patch # Apply it somewhere else: git apply file.patch