While a git sub module could be added with a single line command such as:
git submodule add https://github.com/UrlToRepository.git foldernameofrepository
it can be cumbersome to remove a submodule. There are various steps involved such as given in the next paragraph.
To remove a submodule you need to:
- Delete the relevant section from the
- Stage the
git add .gitmodules
- Delete the relevant section from
git rm --cached path_to_submodule (no trailing slash).
rm -rf .git/modules/path_to_submodule
git commit -m "Removed submodule <name>"
- Delete the now untracked submodule files
rm -rf path_to_submodule
To update all submodule within a repository one would do:
git submodule foreach git pull origin master
Taken from Stackoverflow page https://goo.gl/RVfc1q, answered by John Douthat
I had a directory named sites added to my git repository. As it contained a bootstrap file having names of each new domain in multiple sites setup hosted in the single CakePHP application it contained different domain entries and folders as compared to my application in my local machine. Continue reading
Following an answer (http://goo.gl/EcqpTZ) here’s what I did to setup the Git Bash environment to log me in once when I start it up. This method worked for me to make “remember me” working or to save my password for my local git account so I dont have to type it everytime I want to do a push or pull. Continue reading
Ref. Ignoring “Your local changes to the following files would be overwritten by merge” on pull
git checkout HEAD^ file/to/overwrite
Ignoring versioned files
To start ignoring a file
$ git update-index --assume-unchanged path/to/file.txt
To start track again
$ git update-index --no-assume-unchanged path/to/file.txt
You can pull one or all public submodules with git using the following commands :
git submodule update --init [PATH TO SUBMODULE]
Ex. git submodule update --init c:/wamp/www/site/subfolder
git submodule update –init,
more coming soon..