Code Submission Guide

    Go to the github page (opens new window) of apache/incubator-doris , and click the button in the upper right corner for Fork.

    Fork

    (1) Clone the code locally:

    Note: Please replace your GitHub name with your yourgithubname\\\\\\\.

    When clone is completed, origin defaults to the remote fork address on github.

    (2) Add apache/incubator-doris to the remote branch upstream of the local warehouse:

    1. cd incubator-doris
    2. git remote add upstream https://github.com/apache/incubator-doris.git

    (3) Check remote warehouse settings:

    1. origin https://github.com/<your_github_name>/incubator-doris.git (fetch)
    2. origin https://github.com/<your_github_name>/incubator-doris.git (push)
    3. upstream https://github.com/apache/incubator-doris.git (fetch)
    4. upstream https://github.com/apache/incubator-doris.git (push)

    (4) New branches to modify them:

    1. git checkout -b <your_branch_name>

    Note: <your_branch_name> name is customized for you.

    Code changes can be made after creation.

    (5) Submit code to remote branch:

    1. git commit -a -m "<you_commit_message>"
    2. git push origin <your_branch_name>

    (1) New PR

    Switch to your GitHub page in the browser, switch to the submitted branch yourbranchname\ and click the New pull request button to create it, as shown in the following figure:

    (2) preparation branch

    At this time, the Create pull request button will appear. If not, please check whether the branch is selected correctly or click on `compare across forks’ to re-select the repo and branch.

    create PR

    (3) Fill Commit Message

    Here, please fill in the summary and details of the comment, and then click Create pull request to create it.

    For how to write Commit Message, here are some Tips:

    • Please use the form of English verb + object. The verb does not use the past tense and the sentence uses imperative sentence.
    • Subject and body should be written, and they should be separated by blank lines (fill in separately on GitHub PR interface).
    • Message topic length should not exceed 50 characters;
    • Message content should not exceed 72 characters per line, and the excess should be replaced manually.
    • Message content is used to explain what has been done, why and how.
    • The first letter of the message subject should be capitalized, and the end of the sentence should not have a full stop.
    • The message content specifies the associated issue (if any), such as # 233;

    (4) Complete the creation

    After successful creation, you can see that Doris project needs review, you can wait for us to review and join, you can also contact us directly.

    create PR

    So far, your PR creation is complete. Read more about PR [collaborating-with-issues-and-pull-requests] (https://help.github.com/categories/collaborating-with-issues-and-pull-requests/).

    When submitting PR, code conflicts are usually caused by multiple people editing the same file. The main steps to resolve conflicts are as follows:

    (1) Switch to the main branch

    1. git checkout master

    (2) Synchronize remote main branch to local

    (3) Switch back to the previous branch (assuming the branch is named fix)

    1. git checkout fix

    (4) rebase

    1. git rebase -i master

    At this point, a file that modifies the record will pop up and can be saved directly. Then, we will prompt which files have conflicts. At this time, we can open the conflict file to modify the conflict part. After all the conflicts of the conflict files are resolved, we will execute them.

    1. git add .
    2. git rebase --continue

    (1) fetch to the latest code for the local branch of upstream that has been configured

    1. $ git branch
    2. * master
    3. $ git fetch upstream
    4. remote: Counting objects: 195, done.
    5. remote: Compressing objects: 100% (68/68), done.
    6. remote: Total 141 (delta 75), reused 108 (delta 48)
    7. Receiving objects: 100% (141/141), 58.28 KiB, done.
    8. From https://github.com/apache/incubator-doris
    9. 9c36200..0c4edc2 master -> upstream/master

    (2) rebase

    (3) Check to see if other submissions are not synchronized to their own repo submissions

    1. $ git status
    2. # On branch master
    3. # Your branch is ahead of 'origin/master' by 8 commits.
    4. #
    5. # Untracked files:
    6. # (use "git add <file>..." to include in what will be committed)
    7. #
    8. nothing added to commit but untracked files present (use "git add" to track)

    (4) Merge code submitted by others into their own repo

    1. $ git push origin master
    2. Counting objects: 195, done.
    3. Delta compression using up to 32 threads.
    4. Compressing objects: 100% (41/41), done.
    5. Writing objects: 100% (141/141), 56.66 KiB, done.
    6. Total 141 (delta 76), reused 140 (delta 75)
    7. remote: Resolving deltas: 100% (76/76), completed with 44 local objects.
    8. To https://lide-reed:fc35ff925bd8fd6629be3f6412bacee99d4e5f97@github.com/lide-reed/incubator-doris.git
    9. 9c36200..0c4edc2 master -> master

    (5) New branch, ready for development

    1. $ git checkout -b my_branch
    2. Switched to a new branch 'my_branch'
    3. $ git branch
    4. master
    5. * my_branch

    (6) Prepare to submit after code modification is completed

    1. $ git add -u

    (7) Fill in the message and submit it it to the new local branch

    1. $ git commit -m "Fix a typo"
    2. 1 files changed, 2 insertions(+), 2 deletions(-)

    (8) Push the branch into GitHub’s own repo far away

    At this point, you can create PR according to the previous process.