diff --git a/Documentation/source/Readme/Contribution Process b/Documentation/source/Readme/Contribution Process index 825555ff0a394dcf1e82c5ded10ddefab50f55df..c64915c688da4690d878ad6afaf733c8a026e934 100644 --- a/Documentation/source/Readme/Contribution Process +++ b/Documentation/source/Readme/Contribution Process @@ -83,5 +83,57 @@ If you plan to review (or just establish a remote backup of your work), push the Committing Multiple Repositories (repo init/sync) ************************************************* +#. Configure the token of the global environment. + + repo config --global repo.token {TOKEN} + +The token is generated by choosing **Settings > Security Settings > Private Token** on Gitee. Example: + + repo config --global repo.token 211XXXXXXXXXXXXXXXXXXXXXXXX + +#. Create an issue under any repository to be modified on Gitee, and record the issue number (for example, #I1TVV4 in the following figure). (The issue provides a function similar to changeID of Gerrit and is used to associate multiple repositories to be modified. Skip this step if modification of multiple repositories is not involved.) + +#. Create a branch in the local code workspace, modify the code, and commit the changes. + + repo start branchname --all + +After the code is modified, run the following command in multiple repositories: + + git add . + git commit -m "xxxxxx" + +Alternatively, use the repo tool to batch add or commit the changes in the root directory of the code project: + + repo forall -c 'git add .' + repo forall -c 'git commit -m "xxxxxx"' + +#. Push the code. (repo upload is not supported.) +Specify whether to directly generate a pull request (PR) during code push. The value False indicates that a PR is not directly generated and needs to be manually generated in the fork warehouse. The value True indicates that a PR is generated when the code is pushed to the fork repository. + + repo config repo.pullrequest {True/False} + +For example, if the PR is generated when the push code is selected, run the following command: + + repo config repo.pullrequest True + +Run the following command to push the code: + + repo push --br={BRANCH} --d={DEST_BRANCH} --content={PR_CONTENT} + +BRANCH indicates the local branch, DEST_BRANCH indicates the destination branch (trunk branch), which is usually master, and PR_CONTENT indicates the PR description. If multi-repository committing is involved, the issue number must be entered. Example: + + repo push --br="20200903" --d="master" --content="#I1TVV4" + +On the editing page displayed, open the comment tags for the repository, branch, and commit. + +Save the settings and exit. The repo tool automatically pushes the local branch to the remote fork repository (creates a fork repository if there is no fork repository) and generates a PR. + +The tool automatically associates the PR with the issue. + +Creating a Pull Request +*********************** +Access the fork repository on Gitee, click the button for creating a PR, and select the myfeature branch to generate a PR. (Skip this step if a PR has been automatically created using the repo tool.) + +For details, visit https://gitee.com/help/articles/4128.