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

I am about to deploy my AngularJS based static site as a Github Page with Yeoman. Step 3 of the deployment instructions tell me to do

git subtree push --prefix dist origin gh-pages

but when I enter that I get

git: 'subtree' is not a git command. See 'git --help'.

This SO answer provided me instructions on how to upgrade to the latest git-core and ensure it always get upgraded to the latest stable release.

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

After running those commands I did git --version to make sure I had the latest version and apparently I did since git version 1.8.3.2 was the output. Now when I tried running

git subtree push --prefix dist origin gh-pages

again I still got the same following error

git: 'subtree' is not a git command. See 'git --help'.

Finally I just restarted Ubuntu 12.10 and tried to run the command again but once again, I got the same error.

How come the git subtree command is still not working even though I have upgraded to the current stable release?


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

Why is the `git subtree` not working even though I have git 1.8.3.2 , When running git subtree an error is thrown stating git: 'subtree' is not GitHub is home to over 50 million developers working together to host we either go to a newer Ubuntu or the PPA supports subtree, we'll have it. The git we have installed though still doesn't have subtree, we're on 1.9.1 right now.


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.

git: 'subtree' is not a git command · Issue #2002 · travis-ci/travis-ci , What are the submodule and checkout commands of git for? [closed] install gitk with git 1.8.3.2 [duplicate]. I seem to be I have a git repo on an ubuntu 12.04 machine synced with a remote bit bucket repo. When I fatal: could not create work tree dir 'metasploit-framework'. If I connect from a wired connection (even in .


On Fedora, it is available as a separate package:

dnf install git-subtree

Highest Voted 'git' Questions - Page 8, Git subtree lets you nest one repository inside another as a sub-directory. It is one While submodules are useful for a few use cases, they do have several A diagram showing the interaction between two repositories before and after using Git You can still use the merge strategy even if for some reason git subtree is not 


Git subtree: the alternative to Git submodule, Because this command is now merged into git-core since 1.7.11, we will need to install the latest git from I am using Ubuntu 12.04.1 LTS here. This may not work for you if you're not using Ubuntu (your prefix or libexec dir may be different) .


Installing latest git on Ubuntu with git-subtree support, I have found git subtree very useful in the transition period when splitting large will continue to work well - they'd be using same old branches, and won't require anything additional, not even a single additional Git command. on how you installed Git (Homebrew on Mac, apt-get on Ubuntu, or else) and 


git subtree, Directions for installing git subtree on Mac (OS X) and Ubuntu. But, this post isn 't about how great subtree is or an into to using it. If you If you used homebrew to install git then subtree, along with the rest of the git contrib items, was already placed on your system and can be Ubuntu (12.04 and 12.10).