Skip to content

Instantly share code, notes, and snippets.

@mjsteinbaugh
Forked from slavafomin/git-submodules.md
Created April 1, 2019 21:47
Show Gist options
  • Save mjsteinbaugh/c91dfd8659c20be6220c1d65df1dcbc6 to your computer and use it in GitHub Desktop.
Save mjsteinbaugh/c91dfd8659c20be6220c1d65df1dcbc6 to your computer and use it in GitHub Desktop.

Revisions

  1. Slava Fomin II revised this gist May 8, 2017. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions git-submodules.md
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,16 @@

    `git config --global status.submoduleSummary true`

    — Script for pulling the main repo and updating the sumodules automatically:

    ```bash
    #!/usr/bin/env bash

    git pull "$@" &&
    git submodule sync --recursive &&
    git submodule update --init --recursive
    ```

    ## Additional reading

    - [Mastering Git submodules](https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407)
  2. Slava Fomin II revised this gist May 8, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion git-submodules.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@

    — Initialize submodules after regular cloning:

    `git submodule init && git submodule update`
    `git submodule update --init`

    — Make submodules to track their respective remote branches (instead of being in detached HEAD state):

  3. Slava Fomin II revised this gist May 8, 2017. 1 changed file with 10 additions and 2 deletions.
    12 changes: 10 additions & 2 deletions git-submodules.md
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,19 @@

    ## Useful commands

    * Clone repository with submodules automatically
    Clone repository with submodules automatically:

    `git clone --recursive [email protected]:name/repo.git`

    * Display status of submodules when `git status` is invoked:
    — Initialize submodules after regular cloning:

    `git submodule init && git submodule update`

    — Make submodules to track their respective remote branches (instead of being in detached HEAD state):

    `git submodule foreach -q --recursive 'git checkout $(git config -f $toplevel/.gitmodules submodule.$name.branch || echo master)'`

    — Display status of submodules when `git status` is invoked:

    `git config --global status.submoduleSummary true`

  4. Slava Fomin II revised this gist May 8, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion git-submodules.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,11 @@

    ## Useful commands

    Display status of submodules when `git status` is invoked:
    * Clone repository with submodules automatically

    `git clone --recursive [email protected]:name/repo.git`

    * Display status of submodules when `git status` is invoked:

    `git config --global status.submoduleSummary true`

  5. Slava Fomin II revised this gist May 8, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion git-submodules.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    ## Useful commands

    Display status of submodules as well when `git status` is invoked:
    Display status of submodules when `git status` is invoked:

    `git config --global status.submoduleSummary true`

  6. Slava Fomin II revised this gist May 8, 2017. No changes.
  7. Slava Fomin II revised this gist May 8, 2017. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion git-submodules.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    # Git submodules best practices

    ## Useful commands

    Display status of submodules as well when `git status` is invoked:

    `git config --global status.submoduleSummary true`
    `git config --global status.submoduleSummary true`

    ## Additional reading

    - [Mastering Git submodules](https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407)
  8. Slava Fomin II created this gist May 8, 2017.
    5 changes: 5 additions & 0 deletions git-submodules.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Git submodules best practices

    Display status of submodules as well when `git status` is invoked:

    `git config --global status.submoduleSummary true`