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

3

45

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?

Backdrop answered 22/7, 2013 at 20:59 Comment(2)
It doesn't seem to be installed by the default package. This site has some directions: engineeredweb.com/blog/how-to-install-git-subtreeSerilda
Ahh right thanks. That did it. Feel free to answer it and I will mark it correct if you'd like.Backdrop
S
25

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

Serilda answered 22/7, 2013 at 21:28 Comment(2)
On Ubuntu it was already installed, but I had to add a simlink: cogumbreiro.blogspot.com/2013/05/…Lusk
@Lusk Interesting! BTW building the manpage requires a huge toolchain. I found a patch which adds a pre-built manpage, git-subtree.1: code.google.com/p/git-core/issues/detail?id=18S
M
47

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.

Misbeliever answered 21/11, 2013 at 21:33 Comment(1)
Even after updating to latest from git-core/ppa, subtree is not found. This solution is the real fix for me (Linux Mint 14)Chkalov
S
25

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

Serilda answered 22/7, 2013 at 21:28 Comment(2)
On Ubuntu it was already installed, but I had to add a simlink: cogumbreiro.blogspot.com/2013/05/…Lusk
@Lusk Interesting! BTW building the manpage requires a huge toolchain. I found a patch which adds a pre-built manpage, git-subtree.1: code.google.com/p/git-core/issues/detail?id=18S
T
17

On Fedora, it is available as a separate package:

dnf install git-subtree

Tamatamable answered 23/10, 2019 at 9:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.