Installing and upgrading Git
このページには次の方法が記載されています:
The information on this page applies to installing or upgrading Git on either your local machine, or on the Bitbucket Data Center and Server instance.
Git のバージョンを確認する
The versions of Git supported by Bitbucket are listed on Supported platforms.
You can check your current version of Git by running the git --version
command in a terminal (Linux, macOS) or command prompt (Windows).
例:
git --version
git version 2.7.4
サポートされるバージョンの Git がない場合は、Git をアップグレードするか、以下の方法でフレッシュインストールを実行する必要があります。
Linux で Git をインストールまたはアップグレードする
パッケージマネージャを使用して Git をインストールします。例えば、Ubuntu 13.10 の場合:
sudo apt-get install git
代替ダウンロードオプション:
- Download a version of Git that is compatible with your version of Bitbucket 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. See the Git website
- If you want to use a more recent version of Git than your package manager provides, you can install Git from source. Make sure you check the version is compatible with Bitbucket.
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 macOS
Download a version of Git that is compatible with your version of Bitbucket from the Git website.
downloaded .dmg ファイルをクリックしてから、.pkg アイコンをダブルクリックしてインストーラを実行します。これにより、既存のバージョンの上に新しいバージョンの Git がインストールされます。
あるいは:
- Use the native Git bundled with macOS.
- 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.
Windows で Git をインストールまたはアップグレードする
Download a version of Git that is compatible with your version of Bitbucket 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.
パスで git.exe が利用可能なことを確認するには、以下のいずれかを選択します:
- Windows コマンドプロンプトで Git を実行するか、あるいは
- Windows コマンドプロンプトから Git と付属の Unix ツールを実行します。
Do not select Use Git Bash only when installing or upgrading Git for the Bitbucket instance -- this will not work.
Now, check the Git version – you should see the new version of Git.
msysGit is the only supported distribution when running Bitbucket 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 Bitbucket, you should abort the installation, restart the Windows server, then restart the Bitbucket installation.
Restart Bitbucket if necessary
If you've been installing or upgrading Git for the Bitbucket instance, rather than for your local machine, you'll need to stop and restart Bitbucket so that it will pick up the upgraded version of Git. See Start and stop Bitbucket for details.