This is to introduce the way to add one subproject with git submodule.
My personal tree is libvirt-ppc.
After pull the tree source code, then cd the directory of libvirt-ppc.
#cd libvirt-ppc
#git submodule add git://git.sv.gnu.org/gnulib.git ./.gnulib
The there is one file called .gitmodules
#cat .gitmodules
[submodule ".gnulib"]
path = .gnulib
url = git://git.sv.gnu.org/gnulib.git
Here we need to do one hack of submodule's name.
It is created as .gnulib, the name is the same as path.
We can modify it as gnulib.
#cat .gitmodules
[submodule "gnulib"]
path = .gnulib
url = git://git.sv.gnu.org/gnulib.git
#git submodule init
#git add .gitmodule
# git add .gnulib
# git commit -s -a
# git push origin HEAD:refs/heads/ppc-next (push to ppc-next branch)
more information, please refer to:
阅读(2213) | 评论(0) | 转发(0) |