Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "Platform-releng/Git Workflows"

(Start working in a new branch)
(Create a patch)
Line 77: Line 77:
  
 
= Create a patch =
 
= Create a patch =
 +
 +
We have 2 options for accepting contributions from the community.  See [[Development_Resources/Handling_Git_Contributions]] (prefered) and [[Git#IP_process_implications_of_DVCS]].
 +
 +
To create a patch:
 +
 +
# You need to show the commits in the history view.
 +
## Either right-click on a file you just committed and '''Show in history'''
 +
## or right-click on the project and '''Show In>History''', then find the commit you want
 +
# right click on the commit in the ''History'' view, and select '''Create Patch'''
 +
# use ''Next'' if you'd like the patch in the standard git mbox format
  
 
= Apply a patch =
 
= Apply a patch =

Revision as of 09:01, 5 July 2011

We'd like to capture some common CVS workflows used by the Eclipse Project and spell out the git/EGit equivalent.

Clone a repo

The first step is to clone the one or more repos you need to work on. You want to clone the repo to a location outside your workspace. Then use the EGit Import Projects option to import the projects.

Refer to the EGit/User Guide for instructions and pictures.

  1. Switch to the Git Repository Exploring Perspective
  2. Use Clone a Git repository Clone a git repository
  3. you can paste in your connection URL and it should do the right thing. Some URLs:
    1. ssh://userid@git.eclipse.org/gitroot/equinox/rt.equinox.bundles.git
    2. ssh://userid@git.eclipse.org/gitroot/equinox/rt.equinox.framework.git
    3. ssh://userid@git.eclipse.org/gitroot/equinox/rt.equinox.incubator.git
    4. ssh://userid@git.eclipse.org/gitroot/equinox/rt.equinox.p2.git
    5. ssh://userid@git.eclipse.org/gitroot/equinox/rt.equinox.security.git
    6. ssh://userid@git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git
    7. ssh://userid@git.eclipse.org/gitroot/jdt/eclipse.jdt.debug.git
    8. ssh://userid@git.eclipse.org/gitroot/jdt/eclipse.jdt.git
    9. ssh://userid@git.eclipse.org/gitroot/jdt/eclipse.jdt.ui.git
    10. ssh://userid@git.eclipse.org/gitroot/pde/eclipse.pde.build.git
    11. ssh://userid@git.eclipse.org/gitroot/pde/eclipse.pde.git
    12. ssh://userid@git.eclipse.org/gitroot/pde/eclipse.pde.incubator.git
    13. ssh://userid@git.eclipse.org/gitroot/pde/eclipse.pde.ui.git
    14. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.debug.git
    15. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.git
    16. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.releng.git
    17. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.resources.git
    18. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.runtime.git
    19. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.swt.git
    20. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.team.git
    21. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.text.git
    22. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.ua.git
    23. ssh://userid@git.eclipse.org/gitroot/platform/eclipse.platform.ui.git
  4. Next
  5. Select all branches to clone
  6. Next
  7. Confirm the location that it will clone the repository into.
  8. an initial branch of master and a remote name of origin are standard.
  9. Finish - Now just sit back while git copies the entire repo to your harddrive :-)

We need to get the projects from the repo into our workspace:

  1. right click on your newly cloned repo and select Import Projects
  2. you want Import existing projects from the Working Directory
  3. Next
  4. Select the projects that you want to import from the repository
  5. Finish

Now you can start working.

Start working in HEAD

To start working in HEAD you must clone your repository and checkout a working copy. By default, cloning the repo checks out the master branch, which is the same as HEAD in CVS.

The constant HEAD is used in GIT as well, but has a completely different meaning. In GIT HEAD means the pointer to the latest commit in your currently checked-out branch (more or less).

See #Clone a repo.

Start working in a new branch

For example, create the R3_7_maintenance branch for your repo. This example is for the case that your branch doesn't already exist as refs/remotes/origin/R3_7_maintenance.

  1. right click on one of your projects and choose Team>Switch To>New Branch
  2. you need to pick a source ref.
    1. HEAD == current checked out commit
    2. refs/heads/master means your master branch.
    3. refs/remotes/origin/R3_7_maintenance - the existing remote branch. If you pick this one and name your local branch the same, EGit will automatically create a tracked branch.
    4. refs/tags/R3_7 is the tags to branch from
  3. name the branch R3_7_maintenance
  4. leave "Check out the new branch" selected.

This will create a new branch for you to work on. Once you've made your initial commits, you need #Commit changes to the main repo. Pushing up to the repo will push any new branches you've created as well.


PW

Create a patch

We have 2 options for accepting contributions from the community. See Development_Resources/Handling_Git_Contributions (prefered) and Git#IP_process_implications_of_DVCS.

To create a patch:

  1. You need to show the commits in the history view.
    1. Either right-click on a file you just committed and Show in history
    2. or right-click on the project and Show In>History, then find the commit you want
  2. right click on the commit in the History view, and select Create Patch
  3. use Next if you'd like the patch in the standard git mbox format

Apply a patch

Tag the mapfile for a build

Commit changes to the main repo

Update to pull in the latest changes to HEAD

Merge conflicting changes

Copyright © Eclipse Foundation, Inc. All Rights Reserved.