Stash is now known as Bitbucket Server.
See the

Unknown macro: {spacejump}

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

新しいリポジトリを作成すると、既存のプロジェクトから Stash をインポートできます。これを行うには、最初にリポジトリをローカルのコンピューターへ複製してから、空の Stash リポジトリへプッシュします。

このページの内容

バージョン管理外の既存コードプロジェクトを Stash へインポートする

ソースコントロールがされていないローカルのコンピューター上にコードがある場合、そのコンピューターをソースコントロール下に置いて Stash にインポートします。

Assuming you have Git installed on your local machine, then:

  1. Locally, change to the root directory of your existing source.
  2. Initialise the project by running the following commands in the terminal:

    git init
    git add --all
    git commit -m "Initial Commit"
  3. Stash へログインし、新しいリポジトリを作成します
  4. 左のナビゲーションパネルで複製 URL を見つけます (例: https://username@your.stash.domain:7999/yourproject/repo.git)。
  5. Push your files to the repository by running the following commands in the terminal (change the URL accordingly):

    git remote add origin https://username@your.stash.domain:7999/yourproject/repo.git 
    git push -u origin master
  6. 完了です!Stash でリポジトリを利用できるようになりました。

既存の Git プロジェクトを Stash へインポートする

既存の Git リポジトリを Stash 内の空のリポジトリへインポートできます。これを行う場合、Stash はコミット履歴を保持します。

  1. Check out the repository from your existing Git host. Use the --bare parameter:

    git clone --bare https://username@bitbucket.org/exampleuser/old-repository.git
  2. Log into Stash and create a new repository (we've called it repo.git in this example).

  3. 左のナビゲーションパネルで複製 URL を見つけます (例: https://username@your.stash.domain:7999/yourproject/repo.git)。

  4. Stash をローカルリポジトリの別のリモートとして追加:

    cd old-repository
    git remote add stash https://username@your.stash.domain:7999/yourproject/repo.git
  5. すべてのブランチとタグを、Stash の新しいリポジトリへプッシュ:

    git push --all stash
    git push --tags stash
  6. Remove your temporary local repository:

    cd ..
    rm -rf old-repository

Mirror an existing Git repository

既存のリポジトリを Stash でホストされるリポジトリへミラーリングできます。

  1. Check out the repository from your existing Git host. Use the --mirror parameter:

    git clone --mirror https://username@bitbucket.org/exampleuser/repository-to-mirror.git
  2. Log into Stash and create a new repository (we've called it repo.git in this example).

  3. 左のナビゲーションパネルで複製 URL を見つけます (例: https://username@your.stash.domain:7999/yourproject/repo.git)。

  4. Stash をローカルリポジトリの別のリモートとして追加:

    git remote add stash https://username@your.stash.domain:7999/yourproject/repo.git
  5. 次に、すべてのブランチとタグを Stash へプッシュします:

    git push --all stash
    git push --tags stash
  6. Use git fetch --prune origin ('–prune' will remove any branches that no longer exist in the remote) followed by the git push commands from step 5 to update the Stash mirror with new changes from the upstream repository.
  • ラベルなし