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 でまず最初にできることは、協力者の追加です。

Go to the Users listing in the Administration area.

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

Once you've created a user, click Change permissions to set up their access permissions.

There are 4 levels of user permissions:

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

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

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

プロジェクトを作成する

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

Simply click Create Project in the Projects page.

Complete the form and submit it to create your new project.

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

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

Click the Permissions tab for the project.

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

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

  • Project Administrator — can create, edit and delete repositories and projects, and configure permissions for projects.
  • Contributor — can push to and pull from all the repositories in the project.
  • Observer — can only browse code and comments in, and pull from, the repositories in the project.

リポジトリを作成し、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.

Click Create Repository to open the repository creation form.

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

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

Here you will simply 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.

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.

  • ラベルなし