2

I downloaded and installed git a while back from here http://git-scm.com/ I am running Windows 7. I also use Sourcetree.

I'd now like to update to the latest stable version, but despite searching Google, here & the git website I'm unable to see a clear step-by-step for this.

Do I uninstall via Control Panel first? Then install new version using installer from git site?
Is there a command to update the version from git bash?
Do I just overwrite the current git directory?

I'm a bit worried about breaking something.

If anyone is able to point me in the right direction or give me a hand would be greatly appreciated.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
arumiat
  • 123
  • 2
  • 9

1 Answers1

1

There is no "setup" needed

Unzip it anywhere, and add this to your %PATH%: you have the latest Git.

That way, you can switch between several versions of Git without any issue
(the first one found in the %PATH% is the one used).

Note: The Windows version may lag behind (as of original posting of the comment, v1.9.5 was current on Windows vs Linux, where it was 2.2.2).

Guillaume Darmont
  • 5,002
  • 1
  • 23
  • 35
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks VonC, I'm unfamiliar with the %PATH% and how to add it to this? Additionally, if I've uninstalled the current version as per bullet point 1, how is it possible to switch back to it? Thanks, T – arumiat Jan 19 '15 at 12:25
  • @arumiat http://stackoverflow.com/a/9546345/6309, http://superuser.com/q/317631/141, http://superuser.com/q/284342/141 – VonC Jan 19 '15 at 12:27
  • how is it possible to switch back to it? Simply dosnload the releases you want listed in https://github.com/msysgit/msysgit/releases. Unzip them wherever you want and add the one you want to use to your PATH. – VonC Jan 19 '15 at 12:27
  • Thanks, and when you say to extract/unzip anywhere, I can do this to this directory? Where the old git was installed?C:\Program Files (x86)\Git\ – arumiat Jan 19 '15 at 12:30
  • 1
    @arumiat no that is not recommeded: that folder ``C:\Program Files (x86)\`` is for software installed with msi setup. Do it in `c:\git` for example. That way you have `c:\git\PortableGit-1.9.5-preview20141217`. And you can unzip in `c:\git` other versions of msysgit. – VonC Jan 19 '15 at 12:32
  • That's good to know thanks. Does the same apply for C:\Program Files as well? Never understood the difference. I.e. you recommend that C:\git is a better place than C:\Program Files, as that way I can add different git versions and change the path each time.. – arumiat Jan 19 '15 at 12:35
  • "Does the same apply for ``C:\Program Files\ `` as well?" Yes: that means you have a 64-bits Windows, and 64-bits programs are installed in Does the same apply for ``C:\Program Files\``, while 32-bits programs are installed in ``C:\Program Files (x86)\``. – VonC Jan 19 '15 at 12:37
  • For Git, it doesn't really matter where you unzip it (since there is no standard "uninstall" procedure): when you are done with it, delete the folder where you initially uncompressed it. That's it. And yes, that allows you to have as many different versions of Git as you need. – VonC Jan 19 '15 at 12:38