Implemented copyCommit utility function