Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "MDT/OCL/Dev/EGit"
(→Switch to Remote Branch) |
|||
Line 13: | Line 13: | ||
The change is developed in a branch whose name starts with '''bug/''nnnnnn''''' where ''nnnnnn'' is the Bugzilla number. A short description may follow. | The change is developed in a branch whose name starts with '''bug/''nnnnnn''''' where ''nnnnnn'' is the Bugzilla number. A short description may follow. | ||
+ | * [[#Discard Old Work | Discard Old Work]] to facilitate doing something new | ||
* [[#Create New Branch | Create New Branch]] or [[#Switch to Local Branch | Switch to Local Branch]] or [[#Switch to Remote Branch | Switch to Remote Branch]] | * [[#Create New Branch | Create New Branch]] or [[#Switch to Local Branch | Switch to Local Branch]] or [[#Switch to Remote Branch | Switch to Remote Branch]] | ||
* Develop and test changes | * Develop and test changes | ||
Line 30: | Line 31: | ||
Very simple changes that do not require review, or must be performed in a hurry may be performed directly on the local master branch. | Very simple changes that do not require review, or must be performed in a hurry may be performed directly on the local master branch. | ||
+ | * [[#Discard Old Work | Discard Old Work]] to facilitate doing something new | ||
* [[#Switch to Local Master| Switch to local/'''master''']] | * [[#Switch to Local Master| Switch to local/'''master''']] | ||
* [[#Pull from Upstream | Pull from Upstream]] to synchronize with development stream | * [[#Pull from Upstream | Pull from Upstream]] to synchronize with development stream | ||
Line 48: | Line 50: | ||
[[EGit/User_Guide#Creating_a_New_Local_Branch | A new branch]] should almost always be created as a branch of '''origin/master''', since this gives a simple direct relationship to the development stream. If you use another branch such as local/'''master''' you create a branch of a branch and may encounter difficulties in synchronizing changes or exporting the branch to other repositories that may not be aware of all changes in your local/'''master'''. | [[EGit/User_Guide#Creating_a_New_Local_Branch | A new branch]] should almost always be created as a branch of '''origin/master''', since this gives a simple direct relationship to the development stream. If you use another branch such as local/'''master''' you create a branch of a branch and may encounter difficulties in synchronizing changes or exporting the branch to other repositories that may not be aware of all changes in your local/'''master'''. | ||
+ | |||
+ | |||
+ | ===Discard Old Work=== | ||
+ | |||
+ | EGit is very reluctant to allow you to lose work, so if your current workspace currently contains some experimental changes resulting perhaps from a review or newsgroup query, you must lose these changes before you can proceed. | ||
+ | |||
+ | Changes may be thrown away by Resetting to match some branch, possibly the current one, possibly '''origin/master''', the synchronizing the workspace, and overwriting to lose all changes. | ||
===Switch to Local Branch=== | ===Switch to Local Branch=== |
Revision as of 06:27, 29 July 2011
The Eclipse OCL code is maintained in a GIT repository which is used by Clone Repository. This repository is used in a traditional 'client'/'server' fashion, even though GIT treats all users as peers. The definitive state is on the 'server' at git://git.eclipse.org/gitroot/mdt/org.eclipse.ocl.git. Individual committers establish 'client' clones of the 'server' so that for committers, the definitive development stream is at origin/master and each committer's master is a branch of origin/master. A definitive maintenance stream is at for instance origin/R3_1.
The capabilities of EGit are described at EGit/User Guide. The documentation here is complementary, it describes how the committers use EGit to satisfy typical use cases.
Contents
- 1 Complete Use Cases
- 2 Partial Use Cases
- 2.1 Clone Repository
- 2.2 Create New Branch
- 2.3 Discard Old Work
- 2.4 Switch to Local Branch
- 2.5 Switch to Remote Branch
- 2.6 Review Changes
- 2.7 Create Patch
- 2.8 Request Review
- 2.9 Rebase Branch onto origin/master
- 2.10 Merge Branch onto origin/master
- 2.11 Merge Branch onto Another Branch
- 2.12 Archive Old Branch
Complete Use Cases
Develop a Non-trivial Change
The normal evolution of the project code involves a non-trivial change that may take a few days or weeks to develop, may need review by another committer and may occur concurrently with some other change.
A Bugzilla describes the intended change and supports communication regarding the progress of the change.
The change is developed in a branch whose name starts with bug/nnnnnn where nnnnnn is the Bugzilla number. A short description may follow.
- Discard Old Work to facilitate doing something new
- Create New Branch or Switch to Local Branch or Switch to Remote Branch
- Develop and test changes
- Review Changes prior to commit
- Commit to Branch
- Push to Upstream to create a backup at Eclipse or to publish to other committers
- Create Patch to attach to Bugzilla for review
- Request Review
- Rebase Branch onto origin/master to synchronize with concurrent development
- Review Changes prior to merge
- Merge Branch onto origin/master to commit to the development stream
- Merge Branch onto Another Branch such as a maintenance branch
- Archive Old Branch to prune the EGit displays
Develop a Trivial Change
Very simple changes that do not require review, or must be performed in a hurry may be performed directly on the local master branch.
- Discard Old Work to facilitate doing something new
- Switch to local/master
- Pull from Upstream to synchronize with development stream
- Develop and test changes
- Review Changes prior to commit
- Commit to local/master
- Merge local/master onto origin/master to commit to the development stream
Partial Use Cases
Clone Repository
The Eclipse GIT repositories are accessed using SSH, so you if you want write access, you should first make sure that you have SSH keys. Then you should use the Git Repositories View of the Git Repository Exploring perspective to Create a clone of the existing Git repository accessed at ssh://committer-id@git.eclipse.org/gitroot/mdt/org.eclipse.ocl.git. committer-id is your Eclipse committer name, typically comprising the first letter of your first name followed by your last name.
Creating the clone takes quite some time, perhaps five to ten minutes, not all of which has comforting progress indications. You can use a file explorer to watch the progress. A complete directory tree for each project appears late in the cloning process.
Create New Branch
A new branch should almost always be created as a branch of origin/master, since this gives a simple direct relationship to the development stream. If you use another branch such as local/master you create a branch of a branch and may encounter difficulties in synchronizing changes or exporting the branch to other repositories that may not be aware of all changes in your local/master.
Discard Old Work
EGit is very reluctant to allow you to lose work, so if your current workspace currently contains some experimental changes resulting perhaps from a review or newsgroup query, you must lose these changes before you can proceed.
Changes may be thrown away by Resetting to match some branch, possibly the current one, possibly origin/master, the synchronizing the workspace, and overwriting to lose all changes.
Switch to Local Branch
Switch to Remote Branch
If the remote branch is relatively new you may need to Fetch from Upstream to update your list of Remote Tracking branches.
Then select any Git project and Switch to Remote Branch. The decoration on all projects should change to show that the selected branch is in use.