-1

iOS プロジェクトを GIT ハブに追加する予定で、GIT の分岐とタグ付けは初めてです。開発と生産のためのシンプルで良い分岐構造を提案してください。

開発用ブランチと本番用ブランチ(マスター)を1つずつ作成した場合、開発中のサブブランチを作成することはできますか?

ヘルプは非常に高く評価されています。

4

4 に答える 4

0

Git フローを見てください。これを適用するのに役立つ Python スクリプトは、こちらから入手できます。

于 2013-07-18T08:02:02.627 に答える
0

最初の作業で ios_project.tar.gz という名前の tarball があるとします。次のように、git リビジョン管理下に置くことができます。

$ tar xzf ios_project.tar.gz
$ cd project
$ git init

Git は応答します。 Initialized empty Git repository in .git/ これで作業ディレクトリが初期化されました。「.git」という名前の新しいディレクトリが作成されていることに気付くかもしれません。

ご主人様はそのままで。開発用と本番用の 2 つのブランチを作成することをお勧めします。不明なコード変更はすべて開発ブランチで行い、作業に確信が持てたら、それを本番ブランチにプッシュしてタグを適用し、後の段階でそれぞれが本番ラインを追跡できるようにします。 .

これに加えて、他の人と共有したい場合は、リポジトリを共有ディレクトリとして持ってください。そして、それを他の開発マシンに複製し、このマシンで開発ブランチを追跡するローカル ブランチを作成し、変更を加えて、オリジンにプッシュします。

次の一連のコマンドは、非常に基本的なレベルで役立ちます。

git clone git@repository_path_on_network/folder_name
git branch usrname_activity_dev --track origin/branch_in_repository
git checkout usrname_activity_dev
git add filenames
git commit -m "comments"
git push origin usrname_activity_dev:branch_in_repository
git checkout local_production_branch
git rebase usrname_activity_dev
git push origin local_production_branch:production_branch_on_repo
git tag tag_name
git push origin local_production_branch:production_branch_on_repo  --tags

これらは非常に基本的なコマンドです。さらにインターネットを利用することをお勧めします。あらゆる状況に応じて、多くのコマンドが見つかります。

于 2013-07-18T07:47:37.047 に答える
0

First of all, branching in Git is unlike branching in Subversion or any other Central VCS. Guess you need one major branch, and from there you can make all possible branches you need. Just remember to merge what you want to keep.

E.g. you branch for production (guess solving problems (branch even per problem)) and you branch for development (sub branching again if needed). And later on you can combine (merge) the changes from the production branch back to the master and all the stuff from your development branches that you want to keep.

But there is no best way - that depends on your use cases. I usually branch per problem (production / issues) and merge it back if solved. The development branch(es) I only add when needed (f.i. before acceptance testing). YMMV.

于 2013-07-18T06:47:14.297 に答える
0

git の任意のコミットから分岐できます。すべてのブランチは同等です。試してみませんか?

SCM 組織はプロジェクト固有のものになる傾向があるため、自分に合ったものであれば何でも構いません。とにかく、クライアントはリポジトリ全体を見るべきではありません。

于 2013-07-18T06:39:02.613 に答える