title: Merging Git submodules back while keeping history
body: <p>We have a repository, in which couple of directories have been extracted as submodules two years ago.</p>
  
  <p>As git submodules cause too much headaches, it was decided to revert the extraction as submodules and bring the directories back to the parent repository.</p>
  
  <p>Now the question is, <strong>what is the best way to do so - while keeping all history</strong>.</p>
  
  <p>I was thinking of adding the submodules as remote and then <code>cherry-pick</code>ing all the changes. But for that I would need to tell git that it shouldn't treat paths of the commit relative to the current directory, not to the parent repo's root.</p>
  
  <p>Does one no a way to do it with <code>cherry-pick</code> or any other clever way?</p>
  
  <p>Thanks a lot!</p>