1

複数のエージェント (分散型) を備えた Bamboo CI システムを使用しています。各ビルドは次に使用可能なエージェントに割り当てられます。また、同じリポジトリの異なるブランチの複数のビルドが同じマシン上で同時に実行される可能性があることに注意してください

私のビルドは、リモートの git リポジトリからコードをチェックアウトする必要があり、それは git との統合に関する限りです。

現在、ビルドは各ビルドの前にリポジトリのクローンを作成し (厳しい要件)、同じファイル システム上の各ブランチの完全な git リポジトリ (つまり .git ディレクトリ) を保持します。

ビルドは、最新のコードをチェックアウトする以外の方法 (プッシュ、プルなど) で git と対話しないため、簡単に言えば、特定の git ブランチの最新バージョンをダウンロードするだけです。

任意の支援をいただければ幸いです

4

4 に答える 4

2

私は決して git の専門家ではありませんが、次の同様の Stack Overflow の質問が正しい方向を示すのに役立つかもしれません。

「git export」(「svn export」など) を実行しますか?

于 2012-03-14T13:55:29.983 に答える
1

Bamboo 3.4 は、「浅いクローン」オプション (マルチ リポジトリ プラン、チェックアウト タスク、git サブモジュールなどのより優れた機能を備えています) をオンにすると、すぐに使用できる Let_Me_Be のアドバイスにほぼ従っていることがわかります。

于 2012-03-26T06:51:01.450 に答える
1
git clone -b branchname --depth 1 git@git.example.com:repository.git /path/to/your/repo

This will create a so called "shallow clone". It only contains the very latest commit of the named branch. Thus you will only pull the absolutely necessary bits.

To cite from the git clone man page:

--depth <depth>
    Create a shallow clone with a history truncated to the specified number
    of revisions. A shallow repository has a number of limitations (you cannot clone
    or fetch from it, nor push from nor into it), but is adequate if you are only
    interested in the recent history of a large project with a long history, and would
    want to send in fixes as patches.

Edit: AFAIK git can not "export" from a remote directory directly. But the approach above is roughly equivalent to an export from remote. If you then don't want the .git directory, just remove it. This is way easier than in the SVN world as you have exactly one, not one in every freaking directory.

于 2012-03-26T07:02:24.480 に答える
1

OK、これは私がそれを行う方法です:

設定:

git init build_dir
cd build_dir
# repeat for all repositories
git remote add REPO_NAME GIT_REPO_URI

特定のブランチをチェックアウトします。

git fetch --all # fetch all updates
git fetch REPO_NAME # just fetch one repo
git checkout master
git reset --hard REPO_NAME/repository

時々実行します:

git gc --aggressive
于 2012-03-14T13:54:07.613 に答える