Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the `git subtree` not working even though I have git 1.8.3.2 installed on Ubuntu 12.10?

People also ask

How does git subtree work?

Adding a subtreeSpecify the prefix local directory into which you want to pull the subtree. Specify the remote repository URL [of the subtree being pulled in] Specify the remote branch [of the subtree being pulled in] Specify you want to squash all the remote repository's [the subtree's] logs.


It actually is installed on Ubuntu but for some reason it's not put anyplace where git can find it. Easiest way is to create a symlink:

sudo chmod +x /usr/share/doc/git/contrib/subtree/git-subtree.sh
sudo ln -s /usr/share/doc/git/contrib/subtree/git-subtree.sh /usr/lib/git-core/git-subtree

UPDATE 1: looks like a patch has been submitted upstream to fix this but it hasn't yet been merged.

UPDATE 2: the patch to fix this in Debian has been merged, but since they went the route of a separate git-subtree package I don't think this will make it to Ubuntu 12.04. Seems to not be an issue in 14.04 as /usr/lib/git-core/git-subtree is already created correctly by the git package.


It doesn't seem to be installed by the default package. This site has some directions: http://engineeredweb.com/blog/how-to-install-git-subtree


On Fedora, it is available as a separate package:

dnf install git-subtree