Skip to content

Merging Development Branches into Master

David Luet edited this page Jul 9, 2015 · 5 revisions

This explains how to merge a branch devel_7.0.0.RC into the branch master of the repository specfem3d_globe. This is an operation that only the codes maintainers can perform.

  1. Build a local clone of the repo

     $ git clone [email protected]:geodynamics/specfem3d_globe.git
    

    Note that this will create a different clone than the one you use for your developments. The origin remote will be the main repository as opposed to your own fork on GitHub. To check that do,

         $ git remote -v
     	origin	[email protected]:geodynamics/specfem3d_globe.git (fetch)
     	origin	[email protected]:geodynamics/specfem3d_globe.git (push)
    
  2. Now pull the branch you want to merge into master, devel_7.0.0.RC in this example

     $ git branch --track devel_7.0.0.RC origin/devel_7.0.0.RC
    

    You can check that the branch has been created with:

        $ git branch
              devel_7.0.0.RC
            * master
    
  3. Merge the local branch devel_7.0.0.RC into the local branch master

     $ git merge devel_7.0.0.RC
    

    Check that the phrase Fast-forward appears in that merge, as in

         $ git merge devel_7.0.0.RC 
         Updating fd75881..b29a9a7
         Fast-forward
    

    If Fast-forward is not there, something went wrong, most likely your branches are out of sync with the central repo. Fix that before you move to the next step.

  4. Push your master branch to the central repo on GitHub. Remember what Uncle Ben said: "With great power comes great responsibility" ...

     $ git push origin master
    
Clone this wiki locally