Installing and upgrading Git

[Security vulnerability CVE-2014-9390] If you are running a Git client older than 1.8.5.6, 1.9.5, 2.0.5, 2.1.4 or 2.2.1 (all released ), you should upgrade Git as soon as possible.

Stash servers are not affected by this vulnerability.

See also this Atlassian blog post: Securing your Git server against CVE-2014-9390.

This page describes how to:

The information on this page applies to installing or upgrading Git on either your local machine, or on the Stash server.

Check your version of Git

The versions of Git supported by Stash are listed on Supported platforms.

You can check your current version of Git by running the git --version command in a terminal (Linux, Mac OS X) or command prompt (Windows).

For example:

git --version 
git version 2.2.1

If you don't see a supported version of Git, you'll need to either upgrade Git or perform a fresh install, as described below.

Install or upgrade Git on Linux

Use your package manager to install Git. For example, on Ubuntu 13.10, use:

sudo apt-get install git

Alternative download options are:

  • Download the latest stable Git release from the Git website
  • If you are using a different Linux distribution, you may need to use a different package repository to get the latest stable version of Git. 
  • If you need the most recent version of Git, you might need to install it from source.

 

Now check the Git version – you should see the new version of Git.

If you still can't see the expected Git version, you may need to add the Git install location to your path. Open your ~/.profile file in a text editor and add this line, where <path/to/git> is the install location for Git:

export PATH=$PATH:<path/to/git>

You can use the which git command to find the install location for Git.

Install or upgrade Git on Mac OS X

Download the latest stable Git release from the Git website

Click on the downloaded .dmg file, then double-click the .pkg icon to run the installer. This will install the new version of Git over the existing version:

Alternatively, you can:

  • Use the native Git bundled with OS X.
  • Use Homebrew to download and install Git.

 

Now check the Git version – you should see the new version of Git.

If you still can't see the Git version, you may need to add the Git install location to your path. Open your ~/.profile file in a text editor and add this line, where <path/to/git> is the install location for Git:

export PATH=$PATH:<path/to/git>

You can use the which git command to find the install location for Git.

Install or upgrade Git on Windows

Download the latest stable Git release from the Git website.

Run the Git installer, ensuring that you install into the same location as any existing Git installation. You can use where git to locate existing installations. Installing Git for Windows (msysGit) also installs a supported version of Perl.

To ensure that git.exe is available in the path, choose either:

  • Run Git from the Windows Command Prompt, or 
  • Run Git and included Unix tools from the Windows Command Prompt.

Do not select Use Git Bash only when installing or upgrading Git for the Stash server -- this will not work with Stash.

Now, check the Git version – you should see the new version of Git.

(warning) msysGit is the only supported distribution when running Stash on Windows. Cygwin Git is not supported and has known issues.

If you have successfully installed msysGit but you receive the error "Unable to find git!" when installing Stash, you should abort the installation, restart the Windows server, then restart the Stash installation.

 

Restart Stash if necessary

If you've been installing or upgrading Git for the Stash server, rather than for your local machine, you'll need to stop and restart Stash so that it will pick up the upgraded version of Git. See Starting and stopping Stash for details.

 

Redirection notice

This page will redirect to /display/BitbucketServer/Installing+and+upgrading+Git .

[Security vulnerability CVE-2014-9390] If you are running a Git client older than 1.8.5.6, 1.9.5, 2.0.5, 2.1.4 or 2.2.1 (all released ), you should upgrade Git as soon as possible.

Stash servers are not affected by this vulnerability.

See also this Atlassian blog post: Securing your Git server against CVE-2014-9390.

This page describes how to:

The information on this page applies to installing or upgrading Git on either your local machine, or on the Stash server.

Check your version of Git

The versions of Git supported by Stash are listed on Supported platforms.

You can check your current version of Git by running the git --version command in a terminal (Linux, Mac OS X) or command prompt (Windows).

For example:

git --version 
git version 2.2.1

If you don't see a supported version of Git, you'll need to either upgrade Git or perform a fresh install, as described below.

Install or upgrade Git on Linux

Use your package manager to install Git. For example, on Ubuntu 13.10, use:

sudo apt-get install git

Alternative download options are:

  • Download the latest stable Git release from the Git website
  • If you are using a different Linux distribution, you may need to use a different package repository to get the latest stable version of Git. 
  • If you need the most recent version of Git, you might need to install it from source.

 

Now check the Git version – you should see the new version of Git.

If you still can't see the expected Git version, you may need to add the Git install location to your path. Open your ~/.profile file in a text editor and add this line, where <path/to/git> is the install location for Git:

export PATH=$PATH:<path/to/git>

You can use the which git command to find the install location for Git.

Install or upgrade Git on Mac OS X

Download the latest stable Git release from the Git website

Click on the downloaded .dmg file, then double-click the .pkg icon to run the installer. This will install the new version of Git over the existing version:

Alternatively, you can:

  • Use the native Git bundled with OS X.
  • Use Homebrew to download and install Git.

 

Now check the Git version – you should see the new version of Git.

If you still can't see the Git version, you may need to add the Git install location to your path. Open your ~/.profile file in a text editor and add this line, where <path/to/git> is the install location for Git:

export PATH=$PATH:<path/to/git>

You can use the which git command to find the install location for Git.

Install or upgrade Git on Windows

Download the latest stable Git release from the Git website.

Run the Git installer, ensuring that you install into the same location as any existing Git installation. You can use where git to locate existing installations. Installing Git for Windows (msysGit) also installs a supported version of Perl.

To ensure that git.exe is available in the path, choose either:

  • Run Git from the Windows Command Prompt, or 
  • Run Git and included Unix tools from the Windows Command Prompt.

Do not select Use Git Bash only when installing or upgrading Git for the Stash server -- this will not work with Stash.

Now, check the Git version – you should see the new version of Git.

(warning) msysGit is the only supported distribution when running Stash on Windows. Cygwin Git is not supported and has known issues.

If you have successfully installed msysGit but you receive the error "Unable to find git!" when installing Stash, you should abort the installation, restart the Windows server, then restart the Stash installation.

 

Restart Stash if necessary

If you've been installing or upgrading Git for the Stash server, rather than for your local machine, you'll need to stop and restart Stash so that it will pick up the upgraded version of Git. See Starting and stopping Stash for details.

 

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport