threads / discuss / 29444

git version not changed after installing new version

Subject: git version not changed after installing new version

## tl;dr

14 messages between Jan 25, 2012 and Jan 26, 2012.

replies: 13people: 5as markdown or json

freefly· Jan 25, 2012, 16:45 UTC · lore
Hi all,
    I am new to Mac OS X lion and I had a previous installation of XCODE 4.2
on my mac mini. It has a git version 1.7.5.4. I installed a new version 1.7.8.4.
and updated the Path variables by running the script comes with the 
package as well. but when I type "git --version" in the terminal 
I get 1.7.5.4. Can anyone tell me what is going wrong ?
Kind regards
Kirill Likhodedov· Jan 25, 2012, 16:57 UTC · re: freefly · lore

Re: git version not changed after installing new version

Most likely, you didn't update the PATH well enough. Check what is the output of 'which git' command. It will point to the xcode installation. So please double check the path.

25.01.2012, в 20:45, freefly:
Show 13 quoted lines
> Hi all,
>    I am new to Mac OS X lion and I had a previous installation of XCODE 4.2
> on my mac mini. It has a git version 1.7.5.4. I installed a new version 1.7.8.4.
> and updated the Path variables by running the script comes with the 
> package as well. but when I type "git --version" in the terminal 
> I get 1.7.5.4. Can anyone tell me what is going wrong ?
> 
> Kind regards
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thomas Rast· Jan 25, 2012, 17:03 UTC · re: freefly · lore

Re: git version not changed after installing new version

freefly <free.fly@live.com> writes:
Show 6 quoted lines
> Hi all,
>     I am new to Mac OS X lion and I had a previous installation of XCODE 4.2
> on my mac mini. It has a git version 1.7.5.4. I installed a new version 1.7.8.4.
> and updated the Path variables by running the script comes with the 
> package as well. but when I type "git --version" in the terminal 
> I get 1.7.5.4. Can anyone tell me what is going wrong ?

Enter 'which git' in a terminal. The 'which' utility looks up which executable from $PATH will be run if you use 'git' (in this case) as a command word, i.e., without specifying its path.

This should point to your newly installed git. It probably doesn't, and you can compare it and your $PATH (try: 'echo "$PATH"' in a terminal) to see why.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
freefly· Jan 25, 2012, 17:19 UTC · re: freefly · lore

Re: git version not changed after installing new version

Thanks both of you for your replies, I have checked but, it still points to the old "/usr/bin/git" not the "/usr/local/git/bin" :(

when I run the update path script I get this output.

No change to PATH in ~/.MacOSX/environment.plist ~ /Volumes/Git 1.7.8.3 Snow Leopard Intel Universal /Volumes/Git 1.7.8.3 Snow Leopard Intel Universal

Carlos Martín Nieto· Jan 25, 2012, 18:57 UTC · re: freefly · lore

Re: git version not changed after installing new version

On Wed, 2012-01-25 at 17:19 +0000, freefly wrote:
> Thanks both of you for your replies, I have checked but, 
> it still points to the old "/usr/bin/git" not the 
> "/usr/local/git/bin" :(

What do `which git` and `type git` say? Bash remembers where it ran a command so if you install a binary to a new location, it might not find it straight away.

Show 7 quoted lines
> 
> when I run the update path script I get this output.
> 
> 
> No change to PATH in ~/.MacOSX/environment.plist
> ~ /Volumes/Git 1.7.8.3 Snow Leopard Intel Universal
> /Volumes/Git 1.7.8.3 Snow Leopard Intel Universal

So the script detected that no change was needed presumably. What's your $PATH and is /usr/local/bin/ before /usr/bin/?

   cmn
freefly· Jan 25, 2012, 19:32 UTC · re: Carlos Martín Nieto · lore

Re: git version not changed after installing new version

> What do `which git` and `type git` say? Bash remembers where it ran a
> command so if you install a binary to a new location, it might not find
> it straight away.
which git => /usr/bin/git
type git => git is hashed (/usr/bin/git)
> So the script detected that no change was needed presumably. What's your
> $PATH and is /usr/local/bin/ before /usr/bin/?
 
echo $PATH => /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
                         /usr/X11/bin:/usr/local/git/bin:/opt/local/bin
from the above output it is not before /usr/bin :(
Carlos Martín Nieto· Jan 25, 2012, 19:58 UTC · re: freefly · lore

Re: git version not changed after installing new version

Please don't cull the CC list. It's customary in the git ML to send a copy of the message to each participant.

On Wed, 2012-01-25 at 19:32 +0000, freefly wrote:
Show 16 quoted lines
> 
> > What do `which git` and `type git` say? Bash remembers where it ran a
> > command so if you install a binary to a new location, it might not find
> > it straight away.
> 
> which git => /usr/bin/git
> 
> type git => git is hashed (/usr/bin/git)
> 
> > So the script detected that no change was needed presumably. What's your
> > $PATH and is /usr/local/bin/ before /usr/bin/?
>  
> echo $PATH => /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
>                          /usr/X11/bin:/usr/local/git/bin:/opt/local/bin
> 
> from the above output it is not before /usr/bin :(

There you go then. That should get set in ~/.bashrc so edit that file to change the order.

   cmn
freefly· Jan 25, 2012, 20:20 UTC · re: Carlos Martín Nieto · lore

Re: git version not changed after installing new version

> Please don't cull the CC list. It's customary in the git ML to send a
> copy of the message to each participant.
> 
> There you go then. That should get set in ~/.bashrc so edit that file to
> change the order.
> 
>    cmn

I didn't the rules about ML and culling some of them have guidelines to reduce the noise.

So you want me to edit the ~/.bashrc and put change the order of those paths ?

Carlos Martín Nieto· Jan 25, 2012, 22:29 UTC · re: freefly · lore

Re: git version not changed after installing new version

On Wed, 2012-01-25 at 20:20 +0000, freefly wrote:
Show 13 quoted lines
> > Please don't cull the CC list. It's customary in the git ML to send a
> > copy of the message to each participant.
> > 
> 
> > There you go then. That should get set in ~/.bashrc so edit that file to
> > change the order.
> > 
> >    cmn
> 
> I didn't the rules about ML and culling some of them 
> have guidelines to reduce the noise. 
> So you want me to edit the ~/.bashrc 
> and put change the order of those paths ?

With the places you've installed git in, that's what you need to do. You need to tell your shell to look at /usr/local/bin before /usr/bin, otherwise it won't use your locally-installed git.

   cmn
freefly· Jan 26, 2012, 15:13 UTC · re: freefly · lore

Re: git version not changed after installing new version

that doesn't seem to change the path :(
which git => /usr/bin/git
version still points to the old one  :(
This is my current path that I changed, as you told me to do... 
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin
Holger Hellmuth· Jan 26, 2012, 16:52 UTC · re: freefly · lore

Re: git version not changed after installing new version

On 26.01.2012 16:13, freefly wrote:
Show 9 quoted lines
> that doesn't seem to change the path :(
>
> which git =>  /usr/bin/git
>
> version still points to the old one  :(
>
> This is my current path that I changed, as you told me to do...
>
> /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin

Put /usr/local/git/bin in front (it is easy to overlook the "git/" in there as software often uses /usr/local/bin)

freefly· Jan 26, 2012, 17:52 UTC · re: Holger Hellmuth · lore

Re: git version not changed after installing new version

> Put /usr/local/git/bin in front (it is easy to overlook the "git/" in 
> there as software often uses /usr/local/bin)
That worked. Thank you very much.
freefly· Jan 25, 2012, 20:23 UTC · re: Carlos Martín Nieto · lore

Re: git version not changed after installing new version

Sorry about the last post, I had to prune some things from the message, because when I was trying to post it just keep telling me that I have more quoted text than what I have written :(

← back to recent threads