私はGITを使ったバージョン管理は初めてです。私はこのガイドを読み、ここの図に示されている基本的なアプローチに従っています。それでも、新しい機能の開発を既存のコードから分離するために git ブランチを使用する方法については、いくつか疑問があります。
ここに例があります。最初に、私のリポジトリに次の 2 つの主要なブランチが含まれているとします。
- マスター ブランチ (リリース バージョンを含む)
- ブランチの開発 (既存のプロジェクト機能から分離するための新しい修正または機能を含む)
新しい機能やモジュールを開発する必要があるときは、Develop からブランチを作成し、そこで新しいコード プロジェクトを開始します。たとえば、Sun
、Star
、および に関連する機能を追加するために 3 つの新しいブランチを作成しますSuperNova
。現在、私のリポジトリには 5 つのブランチが含まれています。
- Master branch: Release 1.0.0
- Develop branch: Modification after release 1.0.0
- NewModule_Sun branch: add Sun to project (create from Develop branch)
- NewModule_Star branch: add Star to project (create from Develop branch)
- NewModule_SuperNova branch: add SuperNova to Project (create from Develop branch)
For Release 1.0.1, I want to include the the Sun
and Star
modules, but not SuperNova
. So, I merge them with Develop and then merge Develop with the Release:
- Merge NewModule_Sun into Develop
- Merge NewModule_Star into Develop
- Merge Develop into Master (release 1.0.1)
The Develop branch needs to be kept permanently, but the Sun
and Star
branches are no longer needed. They get deleted:
- Delete the NewModule_Sun branch
- Delete the NewModule_Star branch
After these changes my repository contains the following three branches:
- Master Branch: Release 1.0.1
- Develop Branch: Modification after release 1.0.1
- NewModule_SuperNova branch: Modification after release 1.0.0 (created from Develop when it was not merged with the Star/Sun branches)
==
Firstly, am I using git branches correctly?
Secondly, I reviewed the history of the final Develop branch, and it seems that I have lost some information on the NewModules
. Is that normal? And, is it possible to transfer all the history information to the Develop branch?
Thank you!!