Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git remove submodule

# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule

# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule

# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule
Comment

remove submodule git

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 "
Delete the now untracked submodule files rm -rf path_to_submodule
Comment

git submodule remove

# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule

# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule

# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule

#Remember to commit the remove change!
git commit -m "removed submodule"
Comment

git remove submodules

git submodule foreach -q git config -l
Comment

git remove submodule keep files

mv subfolder subfolder_tmp
git submodule deinit subfolder
git rm --cached subfolder
mv subfolder_tmp subfolder
git add subfolder
Comment

git remove submodule

Option 1.
Remove .gitmodules file from project

Option 2.
rm -rf .git/modules/path_to_submodule

Remember to commit the remove change!
Comment

PREVIOUS NEXT
Code Example
Shell :: free space in ubuntu 
Shell :: how to find device model of laptop on linux 
Shell :: container registry permissions gcp 
Shell :: pyenv install mint 
Shell :: command lxd not found - linux 
Shell :: how create new git branch 
Shell :: pacman arch 
Shell :: ssh leave process running 
Shell :: install conky on pop os 
Shell :: mysql backup dump docker file 
Shell :: gnome terminator 
Shell :: bash script wget 
Shell :: github axios 
Shell :: git tag older commit 
Shell :: how to zip a folder in putty 
Shell :: how to locate a file in linux 
Shell :: convert to png images liunx 
Shell :: float calculation bash 
Shell :: windows battery report health 
Shell :: UnicodeDecodeError 
Shell :: mongo shell command to create database 
Shell :: git sync branch from master 
Shell :: How to remove all local branches which are merged or not on remote branches 
Shell :: bash add default argument 
Shell :: cmd / batch change to directory on another drive 
Shell :: vue telephone number 
Shell :: chakraUI 
Shell :: homebrew tomcat 
Shell :: how to install emmet atom 
Shell :: helm commands 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =