Implement the 'merge' sub-command