Skip to content

Instantly share code, notes, and snippets.

@mTvare6
Last active May 23, 2023 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mTvare6/c73ed5c33d2cedcd2b412602cd609535 to your computer and use it in GitHub Desktop.
Save mTvare6/c73ed5c33d2cedcd2b412602cd609535 to your computer and use it in GitHub Desktop.
Have this file in dotfiles and run it, so all dependencies get resolved automatically
ROOTREPOPATH="$(pwd)/"
find . -name .git | grep -vE '^./.git' | {
while read i;
do
cd $i/..
REPOPATH=$(pwd)
REPOLINK=$(git config --get remote.origin.url)
cd $ROOTREPOPATH
REPORELPATH=$(echo "$REPOPATH" | sed "s|$ROOTREPOPATH||g")
git submodule add $REPOLINK $REPORELPATH && rm -rf $REPORELPATH
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment