DolphinScheduler/CONTRIBUTING.md

100 lines
2.7 KiB
Markdown
Raw Normal View History

2021-12-23 09:28:19 +08:00
# How To Contribute
2019-07-29 19:21:44 +08:00
Start by forking the dolphinscheduler GitHub repository, make changes in a branch and then send a pull request.
2019-07-29 19:21:44 +08:00
## Set up your dolphinscheduler GitHub Repository
2019-07-29 19:21:44 +08:00
There are three branches in the remote repository currently:
2021-12-23 09:28:19 +08:00
- `master` : normal delivery branch. After the stable version is released, the code for the stable version branch is merged into the master branch.
- `dev` : daily development branch. The daily development branch, the newly submitted code can pull requests to this branch.
- `x.x.x-release` : the stable release version.
2019-07-29 19:21:44 +08:00
So, you should fork the `dev` branch.
2019-07-29 19:21:44 +08:00
After forking the [dolphinscheduler upstream source repository](https://github.com/apache/dolphinscheduler/fork) to your personal repository, you can set your personal development environment.
2019-07-29 19:21:44 +08:00
```sh
2021-12-23 09:28:19 +08:00
cd <your work direcotry>
git clone <your personal forked dolphinscheduler repo>
cd dolphinscheduler
```
2019-07-29 19:21:44 +08:00
2021-12-23 09:28:19 +08:00
## Set git remote as `upstream`
2019-07-29 19:21:44 +08:00
Add remote repository address, named upstream
2019-07-29 19:21:44 +08:00
```sh
git remote add upstream https://github.com/apache/dolphinscheduler.git
```
2019-07-29 19:21:44 +08:00
View repository:
2019-07-29 19:21:44 +08:00
```sh
git remote -v
```
2019-07-29 19:21:44 +08:00
There will be two repositories at this time: origin (your own warehouse) and upstream (remote repository)
2019-07-29 19:21:44 +08:00
Get/update remote repository code (already the latest code, skip it).
2019-07-29 19:21:44 +08:00
```sh
git fetch upstream
2019-07-29 19:21:44 +08:00
```
Synchronize remote repository code to local repository
```sh
2019-07-29 19:21:44 +08:00
git checkout origin/dev
git merge --no-ff upstream/dev
```
2021-12-23 09:28:19 +08:00
If remote branch has a new branch `dev-1.0`, you need to synchronize this branch to the local repository, then push to your own repository.
2019-07-29 19:21:44 +08:00
2021-12-23 09:28:19 +08:00
```sh
2019-07-29 19:21:44 +08:00
git checkout -b dev-1.0 upstream/dev-1.0
git push --set-upstream origin dev-1.0
2019-07-29 19:21:44 +08:00
```
## Create your feature branch
2021-12-23 09:28:19 +08:00
Before making code changes, make sure you create a separate branch for them.
```sh
2021-12-23 09:28:19 +08:00
git checkout -b <your-feature-branch> dev
```
## Commit changes
2021-12-23 09:28:19 +08:00
After modifying the code locally, submit it to your own repository:
```sh
git commit -m 'information about your feature'
```
## Push to the branch
Push your locally committed changes to the remote origin (your fork).
2019-07-29 19:21:44 +08:00
2021-12-23 09:28:19 +08:00
```sh
git push origin <your-feature-branch>
```
## Create a pull request
2019-07-29 19:21:44 +08:00
After submitting changes to your remote repository, you should click on the new pull request On the following github page.
2019-07-29 19:21:44 +08:00
<p align = "center">
<img src = "http://geek.analysys.cn/static/upload/221/2019-04-02/90f3abbf-70ef-4334-b8d6-9014c9cf4c7f.png" width ="60%"/>
</p>
Select the modified local branch and the branch to merge past to create a pull request.
2019-07-29 19:21:44 +08:00
<p align = "center">
<img src = "http://geek.analysys.cn/static/upload/221/2019-04-02/fe7eecfe-2720-4736-951b-b3387cf1ae41.png" width ="60%"/>
</p>
2019-07-29 19:21:44 +08:00
Next, the administrator is responsible for **merging** to complete the pull request.