OpenMMLab welcomes everyone who is interested in contributing to our projects and accepts contribution in the form of PR.
PR
is the abbreviation of Pull Request
. Here's the definition of PR
in the official document of Github.
Pull requests let you tell others about changes you have pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch.
Get the most recent codebase
Checkout a new branch from dev-1.x
or dev
branch, depending on the version of the codebase you want to contribute to. The main differences between dev-1.x
and dev
is that dev-1.x
depends on MMEngine additionally and it's the main branch we maintains. We strongly recommend you pull request based on more advanced dev-1.x
branch.
Commit your changes (Don't forget to use pre-commit hooks!)
Push your changes and create a PR
Discuss and review your code
Merge your branch to dev-1.x
/ dev
branch
When you work on your first PR
Fork the OpenMMLab repository: click the fork button at the top right corner of Github page
Clone forked repository to local
git clone git@github.com:XXX/mmdetection3d.git
Add source repository to upstream
git remote add upstream git@github.com:open-mmlab/mmdetection3d
After your first PR
Checkout the latest branch of the local repository and pull the latest branch of the source repository. Here we assume that you are working on the dev-1.x
branch.
git checkout dev-1.x
git pull upstream dev-1.x
dev-1.x
/ dev
branchgit checkout -b branchname
To make commit history clear, we strongly recommend you checkout the `dev-1.x` branch before creating a new branch.
If you are a first-time contributor, please install and initialize pre-commit hooks from the repository root directory first.
pip install -U pre-commit
pre-commit install
Commit your changes as usual. Pre-commit hooks will be triggered to stylize your code before each commit.
# coding
git add [files]
git commit -m 'messages'
Sometimes your code may be changed by pre-commit hooks. In this case, please remember to re-stage the modified files and commit again.
Push the branch to your forked remote repository
git push origin branchname
Create a PR
Revise PR message template to describe your motivation and modifications made in this PR. You can also link the related issue to the PR manually in the PR message (For more information, checkout the official guidance).
Specifically, if you are contributing to dev-1.x
, you will have to change the base branch of the PR to dev-1.x
in the PR page, since the default base branch is master
.
You can also ask a specific person to review the changes you've proposed.
dev-1.x
/ dev
branch and delete the branchAfter the PR is merged by the maintainer, you can delete the branch you created in your forked repository.
git branch -d branchname # delete local branch
git push origin --delete branchname # delete remote branch
Use pre-commit hook to avoid issues of code style
One short-time branch should be matched with only one PR
Accomplish a detailed change in one PR. Avoid large PR
Provide clear and significant commit message
Provide clear and meaningful PR description
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )