submodule

git submodule #

拉取 submodule #

git submodule init
git submodule update --remote

git submodule add -b #

参考:

submodule 修改 url #

  • edit the .gitmodules file to update the URL
  • git submodule sync

参考: How to change the remote repository for a git submodule?

delete submodule #

  • 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

参考:


untracked status #

[submodule "example"]
    path = example
    url = git://github.com/ikingye/example.git
    ignore = dirty

本文访问量

本站总访问量

本站总访客数