You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Submit a change for Code or Documentation in Git

Prerequisites

Command-line instructions here assume you have "hub" installed. If you do not use "hub", you should be able to accomplish the same thing using the github.com web site plus some git commands. You can alias "git" to "hub" for ease of use, but here we'll use "hub" explicitly for clarity. Instructions below use GHuser in place of your github username.

Initial Steps (need not be repeated for subsequent changes)

  1. Clone the trafodion repo from the GitHub mirror

OR

    • hub clone -p apache/incubator-trafodion                      ## -p option for ssh
  1. Fork the repo on github , if you have never done so.
    • hub fork

OR

Create a Task Branch

  1. Make sure you have the latest changes
    • git fetch --all
  2. Base your branch on the latest master
    • git checkout -b MyBranch origin/master

Make Changes

  • Edit, Build, Test, Repeat
  • You may make multiple local commits as desired. Unlike the gerrit tool, you do not need to keep your changes in a single commit.
  • Depending on how long you work on the changes you may want to rebase your branch, using git rebase.
  • Prior to pushing your changes to github, you may use git commands that alter your branch history:
    • commit --amend, rebase, merge --squash

Push Changes to your GitHub Fork

  1. Push the branch to your github repo, specifying the branch (or HEAD) to push. The remote is named the same as your github user ID (created earlier by "hub fork" or "git remote add...").
    1. git push -n GHuser HEAD ## dry-run option to check
    2. git push GHuser MyBranch
  2. Once you publish your changes in this way, you should not subsequently use git commands that alter your branch history:
    • commit --amend, rebase, merge --squash

Create a Pull Request

  1. Request your branch to be pulled to apache/incubator-trafodion
    • hub pull-request
  2. Be sure to include the JIRA ID in the title of your pull request (PR). This allows all activity on the PR to be mirrored to Jira.
    • [TRAFODION-12345] Cool Feature Xyz
  3. Automated tests are normally triggered to run on every pull request. If you are modifying something that will not affect testing, you can add a phrase to the comments of the pull request:
    • jenkins, skip test

Update your Pull Request

  1. Follow the github conversation on your pull request and respond to questions and issues. You should be automatically subscribed to your own pull requests.
  2. To make additional changes, go to your local working branch and make additional commits. Do NOT use --amend.
    • git checkout MyBranch ; .... ; git commit
  3. Push the branch to your github fork. These changes automatically show up in the pull-request.
    • git push GHuser MyBranch

 

 

 

 

There is no content with the specified labels

  • No labels