Get started with Git

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Atlassian Bitbucket Data Center and Server is the Git repository management solution for enterprise teams. It allows everyone in your organization to easily collaborate on your Git repositories.

This page will guide you through the basics of Bitbucket. By the end you should know how to:

仮定

このガイドでは、ユーザーが過去に Git を体験したことがないと仮定しています。ただし、以下を想定しています。

  • ローカルコンピューターに Git バージョン 1.7.6 以上がインストールされている。
  • サポート対象のブラウザを使用していること。
  • You have Bitbucket installed and running. If you haven't, see Getting started.

Git のリソースを読み、Git を始めるためのヒントを Git のチュートリアルでご確認ください。

Add users to Bitbucket and grant permissions

The first thing you can do is add collaborators.

To add users

  1. Go to the Bitbucket administration area by clicking the cog , then click Users in the Admin screen (under Accounts):
  2. [ユーザーを作成] をクリックし、ユーザー作成フォームに直接移動します。
  3. ユーザーを作成したら、[権限の変更] をクリックしてアクセス権限をセットアップします。


ユーザー認証には 4 のレベルがあります。

  • System Administrator — can access all the configuration settings of the instance.
  • Administrator — same as System Admins, but they can't modify file paths or the instance settings.
  • プロジェクト作成者 — プロジェクトを作成、編集、削除できる。
  • Bitbucket User — active users who can access Bitbucket.

認証の詳細については、「ユーザーとグループ」を参照してください。

See External user directories if you have existing user identities you wish to use with Bitbucket.

最初のプロジェクトを作成し、協力者と共有する

プロジェクトの作成

The next thing you do, is create a project. You'll add repositories to this project later.

[プロジェクト] に移動し、[プロジェクトの作成] をクリックします。フォームを入力して送信し、新しいプロジェクトを作成します。詳細は「プロジェクトの作成」を参照してください。

プロジェクトへのアクセス権を他のユーザーに許可する

プロジェクト管理者は、プロジェクトの権限を他の協力者へ与えることができます。

設定をクリックしてから、次にプロジェクトの権限をクリックします。

「プロジェクトの権限」ページでは、作成済みのプロジェクトに対してユーザーやグループを追加できます。

プロジェクトのアクセス権には 3 のレベルがあります。

  • 管理者 — リポジトリやプロジェクトを作成、編集、および削除でき、プロジェクトの権限を設定できます。
  • 書き込み— プロジェクトのすべてのリポジトリからプッシュやプルができます。
  • 読み取り — プロジェクトのリポジトリのコードヤコメントを参照したり、プルすることのみできます。

詳細については「プロジェクト権限を使用する」を参照してください。

Create a repository and get your code into Bitbucket

リポジトリを作成する

プロジェクト管理者は、プロジェクト内でリポジトリを作成できます。

リポジトリが作成されたら、リポジトリにプロジェクト権限が適用されます。つまり、プロジェクト内で作成されたすべてのリポジトリは、同じアクセスおよび権限設定を共有します。使用したい Git プロジェクトがすでにある場合、「既存のプロジェクトからコードをインポートする」を参照してください。

リポジトリの作成をクリックし、リポジトリ作成フォームを開きます。

フォームを送信すると、リポジトリのホームページに直接遷移します。リポジトリ内にはコンテンツがないため、リポジトリにコードをプッシュするのに役立つ手順が表示されます。詳細は「リポジトリの作成」を参照してください。

クローンとプッシュ

This section describes how to clone the repository you just created and then push a commit back to it. You can see the clone URL to use at the top right of the screen. SSH access may be available.

In a terminal, run the following command (replace <bitbucketURL> with the URL for your instance of Bitbucket):

git clone <bitbucketURL>/git/<projectname>/<reponame>.git

Use your Bitbucket username and password.

ターミナルでの結果は、以下のスクリーンショットのようになるはずです。

 

You should now have a new empty directory tracked by Git, in the user space of your local machine. Let's add some content and push it back to Bitbucket.

<reponame>ディレクトリで、helloworld.txt という名前のテキストファイルを作成し、その中に「Hello World」と書き込みます。

次に、ターミナルで次のコマンドを実行します

cd <reponame>
git add .
git commit -m "My first commit"
git push origin master

If everything went fine, when you refresh the Bitbucketscreen, you will see that the homepage of your repository has been replaced with a file browser showing you a link to helloworld.txt.

これで、協力者とコーディングできるようになりました。

For more information about getting your code into Bitbucket, see Importing code from an existing project

Check out our Git tutorials and training for more information, and have a look at this list of basic Git commands that you will probably use often.


最終更新日 2022 年 11 月 1 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.