Skip to content

Instantly share code, notes, and snippets.

View romanalexander's full-sized avatar

Roman Alexander romanalexander

View GitHub Profile
@romanalexander
romanalexander / git-extract-submodules.sh
Created April 10, 2023 18:45 — forked from Jamesits/git-extract-submodules.sh
Revert `git submodule absorbgitdirs`
#!/usr/bin/env bash
# Revert `git submodule absorbgitdirs`.
# Source: https://stackoverflow.com/a/51763718
# Notes:
# - Nested submodules must be moved first, so if you are specifying submodules manually, make sure the dependencies are correct
# - Assuming latest version of Git and GNU coreutils has been installed in the $PATH
gitextractsubmodules() {
set -e
pushd -- "$(git rev-parse --show-superproject-working-tree)" >/dev/null 2>&1