Child pages
  • Git Workflow for Vendor Branching

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Git can make upgrading to new releases much easier. Since all of the change history for your customizations and uPortal's development are available you only ever end up having to resolve real merge issues with very little noise. In this example we are upgrading to the uportal-4.3.0.6 tag.

  1. Merge the new tag 

    Code Block
    languagebash
    # Follow the steps in Keeping Your Fork Up To Date
     
    # Checkout your vendor branch
    $ git checkout myschool-master
     
    # Merge in the changes that have been made up to uportal-4.3.0.6.  
    # NOTE:  You don't specify upstream/uportal-4.3.0.6. That notation is for a branch not a tag. If you do something like upstream/uportal-4.3.0, you'll get an error message like
    # merge: upstream/uportal-4.3.0 - not something we can merge
    $ git merge uportal-4.3.0.6
  2. Handle Merge Conflicts 

    Code Block
    languagebash
    # Handle any merge errors that come up
    $ git mergetool -y
  3. Test the changes with a local build and deploy

...

Say you've found a bug and want to contribute a fix. The easiest approach is to acknowledge that you want to contribute up front and follow these step.

  1. Follow the steps in Keeping Up To Date
  2. Create a topic branch from the latest merged uPortal tag, this prevents unexpected changes from getting merged later on

    Code Block
    languagebash
    # create branch 'UP-XXXX' based on tag 'uportal-4.0.5'
    $ git checkout -b UP-XXXX uportal-4.0.5
  3. Follow the steps in Git Workflow for Non-Committers - Making a Change to work on the topic branch and submit a pull request
  4. Once you've submitted the pull request (even better, after the pull request has been merged) merge the topic branch into your vendor branch

    Code Block
    languagebash
    # checkout vendor branch
    $ git checkout myschool-master
     
    # merge the topic branch
    $ git merge UP-XXXX
  5. Push the changes 

    Code Block
    languagebash
    # push the changes to your fork
    $ git push origin

...

Say you've fixed a bug on your vendor branch and realize you should contribute the fix back to uPortal. It isn't too late! Follow these steps to see how.

  1. Follow the steps in Keeping Up To Date
  2. Create a topic branch from uPortal master

    Code Block
    languagebash
    # create branch 'UP-XXXX' based on 'master'
    $ git checkout -b UP-XXXX master
  3. Use cherry-pick to merge the specific commits for the fix/feature into the topic branch 

    Code Block
    languagebash
    # Merge in specific commits
    $ git cherry-pick 1a2b3c4d a1b2c3d4
     
    # Handle any merge errors that come up
    $ git mergetool -y
  4. Push your Topic Branch 

    Code Block
    languagebash
    # Push the branch to your fork for others to review
    $ git push origin UP-XXXX
  5. Follow http://help.github.com/send-pull-requests/ to make a pull request from your UP-XXXX topic branch to Jasig/uPortal

...