a guest Oct 23rd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- ### Detached Head
- - If ended up with a detached HEAD, it can be pushed to a remote
- repository (without the need to creating a new local branch) by the following command:
- git push <remote name> HEAD:<remote branch name>
- git push origin HEAD:master
- ### Un-submodule a submodule
- - NOTE: You will lose your submodule’s git history if you follow this solution!
- If you value the submodule history and won’t accept this compromise, do not follow these instructions!
- 1. Move the files and deinit the submodule
- mv yoursubmodule yoursubmodule_tmp
- git submodule deinit yourSubmodule
- git rm --cached yourSubmodule
- mv yoursubmodule_tmp yoursubmodule
- git add yoursubmodule
- 2. Git submodules metadata is stored in the .gitmodules file as shown below.
- Remove the submodule from that file:
- [submodule "yoursubmodule"]
- path = path/to/yoursubmodule
- url = firstname.lastname@example.org/exampleUser/models
- 3. .git/config has a similar entry, remove the submodule from that as well.
- 4. Cleanup the .git/modules directory
- rm -rf .git/modules/yoursubmodule
RAW Paste Data