Skip to content

Instantly share code, notes, and snippets.

@oniryx
Created April 19, 2016 14:00
Show Gist options
  • Save oniryx/d9c45a5ea214690aeb14906c881fbffe to your computer and use it in GitHub Desktop.
Save oniryx/d9c45a5ea214690aeb14906c881fbffe to your computer and use it in GitHub Desktop.
Move git submodule code into the git main repo
#! /bin/bash
#
# WARNING: You will lose all git history of the submodule
#
$submodule_path=''
$backup_path=''
rm -rf $submodule_path/.git
cp -a $submodule_path $backup_path
git submodule deinit -f $submodule_path
git rm -f $submodule_path
git commit -m 'Remove submodule'
cp -a $backup_path $submodule_path
git add $submodule_path
git commit -m 'Add code submodule'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment