Reputation: 1178
I downloaded and installed the latest Git version 1.8.4.2 from http://git-scm.com. I expected various third party Git modules such as Subtree to be available in /usr/local/git/contrib
for installation. However, the contrib
folder only contains a single folder (completion
) inside of it and no other files or folders.
So I have two questions:
Why are modules missing from the contrib
folder?
How do I install Subtree
in absence of the same from the contrib
folder? (I would prefer installing Subtree from official Git source rather than from https://github.com/apenwarr/git-subtree which is now an obsolete repo)
BTW, I'm running OS X Mavericks
Upvotes: 9
Views: 8681
Reputation: 473
git subtree install appears to be broken in the latest git version 2.27.0
https://github.com/git/git
I built and installed from top level no problem: make; make install
.
git: 'subtree' is not a git command. See 'git --help'.
Switched to contrib/subtree
, make; make install
. Still no subtree command. Tried make prefix=~/; make prefix=~/ install
. Still no subtree command.
Turns out git-subtree
was infact siting there in contrib/subtree
. So I copied it to ~/bin
and now it works (smoke coming out of head...).
Upvotes: 0
Reputation: 5557
The current Homebrew-installed git (v2.4.1) does seem to come with git-subtree out of box. Just doing brew install git
or brew update && brew upgrade git
might do the trick.
Upvotes: 1
Reputation: 1909
There are a couple ways to install git subtree on mac depending on how you installed git on your system.
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 installed. To install subtree:
/usr/local/share/git-core/contrib/subtree
.make
which will prepare subtree.make prefix=/usr/local/opt/git/ install
. The prefix is important because the default location the makefile knows about is not where it needs to be installed with homebrew.If you downloaded and installed git using the installer from the git website there is a different method to installing git-subtree:
git/contrib/subtree
directory.make
to prepare subtree.sudo make prefix=/usr install
. The prefix is important for it to be installed in the right location. Note, you need to use sudo to install this because of it's location on the system.reference: how-to-install-git-subtree
Upvotes: 11