1、第一方法git
git clone https://github.com/git/git.git cd git/contrib/subtree sudo make prefix=/usr sudo make prefix=/usr install sudo make prefix=/usr install-doc Then command git subtree should be available.
2、第二種方法github
git clone https://github.com/git/git.git cd contrib/subtree cp git/contrib/subtree/git-subtree /usr/local/ ln -s /usr/local/git-subtree /usr/bin/git-substree
3、檢查git版本,老版本git不支持,須要升級gitspa