一、第一方法
git clone https://github.com/git/git.gitcd git/contrib/subtreesudo make prefix=/usrsudo make prefix=/usr installsudo make prefix=/usr install-docThen command git subtree should be available.
二、第二种方法
git clone https://github.com/git/git.gitcd contrib/subtreecp git/contrib/subtree/git-subtree /usr/local/ln -s /usr/local/git-subtree /usr/bin/git-substree
三、检查git版本,老版本git不支持,需要升级git