Stash is now known as Bitbucket Server.
See the

Unknown macro: {spacejump}

of this page, or visit the Bitbucket Server documentation home page.

Atlassian Stash is the Git repository management solution for enterprise teams. It allows everyone in your organisation to easily collaborate on your Git repositories.

このページは、Stash の基本を通じてガイドします。最後には、次の方法がわかるようになります:

  • 協力者用のアカウントを作成し、これらを権限を持つグループに整理する。
  • プロジェクトを作成し、権限を設定する。
  • リポジトリを作成し、相互作用のための基本コマンドを知る。

このページの内容

仮定

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

Please read Git resources or check out our Git tutorials for tips on getting started with Git.

Stash にユーザーを追加し、権限を与える

Stash でまず最初にできることは、協力者の追加です。

ヘッダーの「構成」メニューをクリックして Stash 管理エリアに移動してから、ユーザー (「アカウント」の下) をクリックします。

Click Create User to go directly to the user creation form:

ユーザーを作成したら、権限の変更をクリックしてアクセス権限を設定します。

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

  • システム管理者 — Stash インスタンスのすべての構成設定にアクセスできる。
  • 管理者 — システム管理者と同じ権限だが、ファイルパスや Stash サーバー設定は変更できない。
  • プロジェクト作成者 — プロジェクトを作成、編集、削除できる。
  • Stash ユーザー — Stash へアクセスできるアクティブユーザー。

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

既存のユーザー ID を Stash と一緒に使用したい場合は、「外部ユーザーディレクトリ」を参照してください。

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

プロジェクトを作成する

Stash で次にできることは、プロジェクトの作成です。このプロジェクトに後からリポジトリを追加します。

「プロジェクト」へ移動し、プロジェクトの作成をクリックします。(最初は、本画面のように多くのプロジェクトは表示されません。)

フォームを入力して送信し、新しいプロジェクトを作成します。

詳細は「プロジェクトの作成」を参照してください。

プロジェクトへのアクセス権を他のユーザーに開く

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

Click the Permissions tab for the project:

On that page you can add users and groups to a project you've already created.

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

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

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

リポジトリを作成し、Stash でコードを取得します。

リポジトリを作成する

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

Once a repository is created, the project permissions are applied to the repository. That means all repositories created in a project share the same access and permission settings.

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

送信されたら、リポジトリホームページへ直接移動します。リポジトリ内にはまだコンテンツがないため、リポジトリへコードをプッシュするのに役立つ指示が表示されます。

詳細は「リポジトリの作成」を参照してください。

シンプルな複製とプッシュ

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 <stashURL> with the URL for your instance of Stash):

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

あなたの Stash ユーザー名とパスワードを使用します。

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

 

この時点で、ローカルコンピューターのユーザースペース内に、Git によって追跡された新しい空のディレクトリが作成されているようです。コンテンツを追加し、Stash にプッシュし返しましょう。

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

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

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

すべてが成功すると、Stash 画面を更新したときに、リポジトリのホームページが、helloworld.txt へのリンクを示すファイルブラウザに置き換えられていることがわかります。

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

For more information about getting your code into Stash, see Importing code from an existing project. Note that huge Git repositories (larger that a few GBs) are likely to impact the performance of the Git client – see this discussion.

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.

  • ラベルなし