egyamado
egyamado

Reputation: 1131

Does it make a difference where Git is installed

I was reading a blog post about installing git, and it says it will be installed in /usr/bin/git

When I check my version using $ which git, terminal shows /usr/local/bin/git. Same result when I checked for Ruby. Does it make different where Git, Ruby or Rails are installed? Can I change that if it's possible?

Upvotes: 1

Views: 92

Answers (3)

Litmus
Litmus

Reputation: 10996

Normally, it should not matter. But, usually, /usr/local/bin is ahead of /usr/bin in the PATH environment variable. So, in future, if another version of the same software, lets say git, is installed into /usr/local/bin, that will take precedence over the one installed in /usr/bin. You can of course manipulate your PATH environment variable to suite your needs.

run this command to see if multiple versions of git have been installed

which -a git

Upvotes: 3

Rajesh Kolappakam
Rajesh Kolappakam

Reputation: 2125

It does not matter as long as all of them are accessible in your PATH for commands.

Is your concern about where the actual repositories will be located - the place where GIT repositories are located is not necessarily the same place where GIT itself is installed.

Upvotes: 1

SH-
SH-

Reputation: 1642

You probably could change it. It might not be worth it.

It will probably be easier just to leave it and remember.

This is sorta like windows install path. Default will be "Program Files" but it often can be changed.

Note that different versions of Windows have differently named program files. This can be an example of such differences also.

Finally it could be that your ruby installed GIT, and that is the path that Ruby chose.

As long as /usr/local/bin/git is in your PATH you should not notice any differences.

Upvotes: 0

Related Questions