Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Expanding on @Mark Longair's answer, I wrote a bash script to automate steps 2 &amp; 3 of the following process:</p> <ol> <li>Clone a 'boilerplate' repo to begin a new project</li> <li>Remove the .git folder and re-initialize as a new repo</li> <li>Re-initialize the submodules, prompting for input before deleting folders</li> </ol> <hr> <pre><code>#!/bin/bash set -e rm -rf .git git init git config -f .gitmodules --get-regexp '^submodule\..*\.path$' &gt; tempfile while read -u 3 path_key path do url_key=$(echo $path_key | sed 's/\.path/.url/') url=$(git config -f .gitmodules --get "$url_key") read -p "Are you sure you want to delete $path and re-initialize as a new submodule? " yn case $yn in [Yy]* ) rm -rf $path; git submodule add $url $path; echo "$path has been initialized";; [Nn]* ) exit;; * ) echo "Please answer yes or no.";; esac done 3&lt;tempfile rm tempfile </code></pre> <p><em>Note: the submodules will be checked out at the tip of their master branch instead of the same commit as the boilerplate repo, so you'll need to do that manually.</em></p> <p>Piping the output from git config into the read loop was causing problems with the prompt for input, so it outputs it to a temp file instead. Any improvements on my first bash script would be very welcome :)</p> <hr> <p>Big thanks to Mark, <a href="https://stackoverflow.com/a/226724/193494">https://stackoverflow.com/a/226724/193494</a>, <a href="https://stackoverflow.com/q/11704353/193494">bash: nested interactive read within a loop that&#39;s also using read</a>, and tnettenba @ chat.freenode.net for helping me arrive at this solution!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload