Skip to content

Instantly share code, notes, and snippets.

@Om4ar
Forked from u840903/git-submodules.md
Created April 28, 2020 11:52

Revisions

  1. @u840903 u840903 renamed this gist May 7, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @u840903 u840903 renamed this gist May 7, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @u840903 u840903 renamed this gist May 7, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @u840903 u840903 renamed this gist May 7, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. @u840903 u840903 revised this gist May 6, 2014. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,15 @@ git push
    cd ...
    git commit . -m "bumped canvasrunner"
    git push
    ```

    ### Clone repositories with submodules
    ```
    git clone --recursive
    ```

    ### Pull submodule if you forgot to clone --recursive
    ```
    cd components/canvasrunner
    git submodule update --init
    ```
  6. @u840903 u840903 revised this gist Apr 24, 2014. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,29 @@
    ### Add a submodule
    ```
    git submodule add https://github.com/janjarfalk/canvasrunner.git components/canvasrunner/
    ```

    ### Update all submodules
    ```
    git submodule foreach git pull origin master
    cd ..
    git commit . -m "Updated submodules"
    git push
    ```

    ### Remove a submodule
    ```
    git submodule deinit components/canvasrunner
    git rm components/canvasrunner
    ```

    ### Edit a submodule
    ```
    cd components/canvasrunner
    <edit>
    git commit . -m "Edited"
    git push
    cd ...
    git commit . -m "bumped canvasrunner"
    git push
    git push
    ```
  7. @u840903 u840903 revised this gist Apr 24, 2014. 1 changed file with 20 additions and 5 deletions.
    25 changes: 20 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,21 @@
    ### Remove Submodule
    git submodule deinit <path>
    git rm <path>
    ### Add a submodule
    git submodule add https://github.com/janjarfalk/canvasrunner.git components/canvasrunner/

    git submodule deinit components/submodule
    git rm components/submodule
    ### Update all submodules
    git submodule foreach git pull origin master
    cd ..
    git commit . -m "Updated submodules"
    git push

    ### Remove a submodule
    git submodule deinit components/canvasrunner
    git rm components/canvasrunner

    ### Edit a submodule
    cd components/canvasrunner
    <edit>
    git commit . -m "Edited"
    git push
    cd ...
    git commit . -m "bumped canvasrunner"
    git push
  8. @u840903 u840903 revised this gist Apr 24, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ## Remove Submodule
    ### Remove Submodule
    git submodule deinit <path>
    git rm <path>

  9. @u840903 u840903 created this gist Apr 24, 2014.
    6 changes: 6 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    ## Remove Submodule
    git submodule deinit <path>
    git rm <path>

    git submodule deinit components/submodule
    git rm components/submodule