On Thu, 22 Nov 2012 01:53:04 -0800 (PST)
Thomas Ferris Nicolaisen <tfn...@gmail.com> wrote:

> > When git is installed a /opt/git folder is created?
> >
> > I'm asking because i was reading 
> >
> > http://git-scm.com/book/en/Git-on-the-Server-Getting-Git-on-a-Server
> >
> > and i don't have /opt/git folder, should i make this folder?
> >
> No, this directory is not installed during Git installation. It's
> just the place where you'll put Git repositories, so you can pick it
> yourself. 

This is wrong.  The "/opt" hierarchy is defined by the FHS [1] to
contain "optional application software packages".  This term is moot,
so in reality /opt is usually used to install binary-only 3rd-party
vendor software which is so broken with regard to integration into the
target system that it goes the Windows route and installs everything
under a single directory.  Suppose a vendor Acme, Inc. has the Nosebleed
software package, then typically the whole software package would be
installed under /opt/acme/nosebleed (with subdirectories 
/opt/acme/nosebleed/bin, /opt/acme/nosebleed/etc and so on).

So, to answer the original question, Git *might* be installed
under /opt, when doing manual compilation, but this is somewhat odd due
to a number of reasons--it's always better to first try installing Git
from a ready-made binary package.  Every sensible OS has Git packaged,
and it's even available for Windows.
So when one installing Git on the server, the first thing to try is to
install it using the usual OS's means, like doing `apt-get install git`
or `yum install git` or whatever applies.

> It can be wise to follow any conventions from your operating system,
> or how your ops/team usually does it.
> As an example, we keep our git repositories in /var/git, cause that's 
> adjacent to where we used to have the SVN repository installed 
> (/var/svnroot).

On a typical Linux-based system a better place would be /var/local/git
as the general rule of thumb is that everything created by hand should
go under "local" hierarchies (like /usr/local and /var/local).

1. http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard


Reply via email to