Skip to content

Instantly share code, notes, and snippets.

@moritzebeling
Forked from myusuf3/delete_git_submodule.md
Last active July 24, 2020 18:35
Show Gist options
  • Save moritzebeling/f5ef9ff2250ca4ce90db60f6e2289ced to your computer and use it in GitHub Desktop.
Save moritzebeling/f5ef9ff2250ca4ce90db60f6e2289ced to your computer and use it in GitHub Desktop.

Revisions

  1. moritzebeling revised this gist Jul 24, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gitting_around.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Gitting around

    To clone a repo with all its submodules:
    - `git clone --recursive [git://url]`

  2. moritzebeling revised this gist Jul 20, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gitting_around.md
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,8 @@ Removing a submodule:
    - Run `git commit -m "Removed submodule [Name of Module]"` to commit the change
    - Delete the now untracked submodule files `rm -rf [path/to/submodule]`

    Load remote branches
    `git fetch origin`
    Load remote branches:
    - `git fetch origin`

    Kirby meets Git
    <https://getkirby.com/docs/cookbook/setup/git>
  3. moritzebeling revised this gist Jul 20, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gitting_around.md
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,8 @@ Removing a submodule:
    - Run `git commit -m "Removed submodule [Name of Module]"` to commit the change
    - Delete the now untracked submodule files `rm -rf [path/to/submodule]`

    Load remote branches
    `git fetch origin`

    Kirby meets Git
    <https://getkirby.com/docs/cookbook/setup/git>
  4. moritzebeling revised this gist Mar 1, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gitting_around.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,9 @@ To clone a repo with all its submodules:
    Add a submodule
    - `git submodule add [git://url] [path/to/submodule]`

    Load submodules if they weren’t when cloning
    - `git submodule update --init`

    Update all submodules:
    - `git submodule foreach git pull origin master`

  5. moritzebeling revised this gist Jun 4, 2019. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gitting_around.md
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,7 @@ Removing a submodule:
    - Run `git rm --cached [path/to/submodule]` (no trailing slash)
    - Run `rm -rf .git/modules/[path/to/submodule]` (no trailing slash)
    - Run `git commit -m "Removed submodule [Name of Module]"` to commit the change
    - Delete the now untracked submodule files `rm -rf [path/to/submodule]`
    - Delete the now untracked submodule files `rm -rf [path/to/submodule]`

    Kirby meets Git
    <https://getkirby.com/docs/cookbook/setup/git>
  6. moritzebeling revised this gist Jun 4, 2019. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gitting_around.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    To clone a repo with all its submodules:
    - `git clone --recursive [git://url]`

    Add a submodule
    - `git submodule add [git://url] [path/to/submodule]`

    Update all submodules:
    - `git submodule foreach git pull origin master`

  7. moritzebeling renamed this gist May 24, 2019. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion delete_git_submodule.md → gitting_around.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,10 @@
    To remove a submodule you need to:
    To clone a repo with all its submodules:
    - `git clone --recursive [git://url]`

    Update all submodules:
    - `git submodule foreach git pull origin master`

    Removing a submodule:
    - Delete the relevant section from **.gitmodules**
    - Stage the .gitmodules changes with `git add .gitmodules`
    - Delete the relevant section from **.git/config**
  8. moritzebeling revised this gist May 22, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions delete_git_submodule.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    To remove a submodule you need to:

    - Delete the relevant section from **.gitmodules** file
    - Delete the relevant section from **.gitmodules**
    - Stage the .gitmodules changes with `git add .gitmodules`
    - Delete the relevant section from **.git/config**
    - Run `git rm --cached [path/to/submodule]` (no trailing slash)
    - Run `rm -rf .git/modules/[path/to/submodule]` (no trailing slash)
    - Commit `git commit -m "Removed submodule [Name of Module]"`
    - Run `git commit -m "Removed submodule [Name of Module]"` to commit the change
    - Delete the now untracked submodule files `rm -rf [path/to/submodule]`
  9. moritzebeling revised this gist May 22, 2019. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions delete_git_submodule.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    To remove a submodule you need to:

    - Delete the relevant section from the .gitmodules file.
    - Stage the .gitmodules changes git add .gitmodules
    - Delete the relevant section from .git/config.
    - Run git rm --cached path_to_submodule (no trailing slash).
    - Run rm -rf .git/modules/path_to_submodule (no trailing slash).
    - Commit git commit -m "Removed submodule <name>"
    - Delete the now untracked submodule files rm -rf path_to_submodule
    - Delete the relevant section from **.gitmodules** file
    - Stage the .gitmodules changes with `git add .gitmodules`
    - Delete the relevant section from **.git/config**
    - Run `git rm --cached [path/to/submodule]` (no trailing slash)
    - Run `rm -rf .git/modules/[path/to/submodule]` (no trailing slash)
    - Commit `git commit -m "Removed submodule [Name of Module]"`
    - Delete the now untracked submodule files `rm -rf [path/to/submodule]`
  10. @myusuf3 myusuf3 created this gist Nov 3, 2014.
    9 changes: 9 additions & 0 deletions delete_git_submodule.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    To remove a submodule you need to:

    - Delete the relevant section from the .gitmodules file.
    - Stage the .gitmodules changes git add .gitmodules
    - Delete the relevant section from .git/config.
    - Run git rm --cached path_to_submodule (no trailing slash).
    - Run rm -rf .git/modules/path_to_submodule (no trailing slash).
    - Commit git commit -m "Removed submodule <name>"
    - Delete the now untracked submodule files rm -rf path_to_submodule