Teach you how to quickly contribute code to RT-Thread on Github

1024 Programmer's Day, first pay tribute to programmers who change the world! I sincerely wish the programmers in the world: no bugs, no overtime, no love, no salary. You who use technology to change the world deserve more beauty!

As an autonomous Internet of Things operating system, RT-Thread has been developed through the open source community. Up to now, hundreds of programmers have contributed code to RT-Thread on Github. Of course, many have not submitted code on Github. Contributors, sincerely thank you for your hard work on RT-Thread!

Fans who support RT-Thread please give the RT-Thread project the main warehouse star: https://github.com/RT-Thread/rt-thread to encourage RT-Thread developers, and hope to have more and more More RT-Thread contributors, contributing more code to RT-Thread!

↓ ↓↓

If you are willing to contribute code to RT-Thread, you are welcome to submit the code via GitHub's fork and pull request procedures. For code requirements, please refer to the coding_style_cn.txt file in the documentation directory of the rt_thread project (https://github.com/RT-Thread/rt-thread/blob/master/documentation/coding_style_cn.txt) .

The following tutorial will guide you how to submit the code and how to submit the code to be officially recognized by RT-Thread. .

First explain the word pull request, pull request means push request, the purpose of the developer to initiate pull request is to request the warehouse maintainer to use the code submitted by the developer. The following is an excerpt from an understanding of netizens:

I tried to explain pull reqeust with an analogy. Think about our high school exams, the teacher's rollover scene. The test papers you make are like warehouses. Your test papers will definitely have a lot of errors, which is equivalent to bugs in the program. The teacher took your test paper, which is equivalent to fork first. Make some modified comments on your volume, which is equivalent to git commit. Finally, the modified test paper is given to you, which is equivalent to issuing a pull request. You get the test paper and correct the error again, which is equivalent to merge.

When you want to correct errors in other people's warehouses, follow the process below:

Forking someone else's warehouse first is equivalent to copying someone else's information. Because there is no guarantee that your modifications must be correct and beneficial to the project, you can't modify them directly in someone else's repository, but instead fork to your own git repository.

Clone to your local branch, do some bug fix, then launch pull request to the original repository, let the original repository manager see the changes you submitted.

The original warehouse manager reviews the bug and, if it is correct, merges into his own project. The meaning of merge is to merge, merge the part of your modified code into the original warehouse to add code or replace the original code. At this point, the entire pull request process is over, the original warehouse has the code you contributed.

Now take the rt-thread repository as an example to illustrate the process of contributing code:

1. fork forks the rt-thread repository to its own git repository.

2. Clone

Clone the rt-thread repository to your local PC.

3. Create a local branch If you want to do your own development on the rtt project, it is best to create your own project branch. If you contribute code directly to rtt, you can directly operate on the master branch.

4. Development

Found a small bug and made changes.

5. Submit to submit a bug to the local repository

6. Keep your local warehouse up to date

Before preparing to launch a Pull Request, you need to synchronize the latest code of the original repository, remember to check if the current project is the latest version.

7. Push to the remote repository and push it to the developer's own remote repository.

8. Initiate and complete the Pull Request

Select the branch you have modified in the git repository and click the create pull request button to launch the pull request.

9. Some conventions for submitting code

After the request is successfully made, the RT-Thread maintainer can see the code you submitted. If the pull request is approved, your code will be merged into the repository.

Here are some things to consider about how to effectively submit a patch:

Your own code strictly follows the RT-Thread code specification; RT-Thread is a clean, clear system, the code is for people to see (the machine code is for the machine), so how to write a clear, clean code It is also a science. I believe that being able to merge a PR is also an improvement to your code;

BSP code, try to ensure that code changes are only limited to BSP, without affecting other code. Regardless of the three seventy-six, greatly modified, regardless of the feeling of other code (kernel, component), refused to refuse, properly!

Please also limit the code of the component to this component. It will be banned and not discussed.

When submitting, change the description of the message, it is best to write the relevant reason, and add the [BSP] / [component name] and so on the message title.

After submitting the PR, look at some feedback. This may include the maintenance person's rectification comments on the review of the code. The PR hangs and ignores the feedback. If it takes a long time, it will be rejected.

All in all, submitting the code and sending PR is to make RT-Thread even better! It is also to make your life have different colors!

At this point, we have completed the process of code contribution.

Congratulations, you are a contributor to RT-Thread. Please continue to submit the code!


Rechargeable Vape

Rechargeable Vape,Rechargeable Vapes,Fume Rechargeable Vape,Electric Rechargeable Vape

Lensen Electronics Co., Ltd , https://www.lensenvape.com

Posted on