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 :: -bash: screen: command not found 
Shell :: install pandas 
Shell :: how to download using curl 
Shell :: rename file in git 
Shell :: git pull remote changes to local 
Shell :: extract from tar gz into folder 
Shell :: get full path of files in directory linux command 
Shell :: shell function example 
Shell :: kubectl port forward 
Shell :: How to change default user in WSL Ubuntu bash on Windows 10 
Shell :: how to start docker in ubuntu 
Shell :: slow internet wifi speed on ubuntu 18.04 
Shell :: calculate float division 
Shell :: bash: fork: Cannot allocate memory 
Shell :: count number of lines in directory linux 
Shell :: linux scroll in flutter 
Shell :: unrachive .tar.gz 
Shell :: clear git cache 
Shell :: docker redis image 
Shell :: windows scan for corrupt files 
Shell :: push new branch to remote 
Shell :: git ignore still sending files 
Shell :: gitflow install linux 
Shell :: git credential manager linux codegrepper 
Shell :: centos install specific kernel headers 
Shell :: git-clone command not found ubuntu 
Shell :: how to install gimp in ubuntu 
Shell :: how to install armitage in kali linux 
Shell :: initialize github repository 
Shell :: undo git rebase 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =