You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+23-25Lines changed: 23 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ Contributing to ZStack
3
3
4
4
Summary
5
5
-------
6
-
This document covers how to contribute to the ZStack project. These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. Your proposed code changes will be published to your own fork of the ZStack project and you will submit a Pull Request for your changes to be added.
6
+
This document covers how to contribute to the ZStack project. These instructions assume you have a GitHub.com account, please create one if you don't have. Your proposed code changes will be published to your own fork of the ZStack project, and you need to submit a Pull Request for your changes to be added.
7
7
8
8
_Lets get started!!!_
9
9
@@ -13,12 +13,12 @@ Fork the code
13
13
14
14
In your browser, navigate to: [https://github.com/zstackorg/zstack](https://github.com/zstackorg/zstack)
15
15
16
-
Fork the repository by clicking on the 'Fork' button on the top right hand side. The fork will happen and you will be taken to your own fork of the repository. Copy the Git repository URL by clicking on the clipboard next to the URL on the right hand side of the page under '**HTTPS** clone URL'. You will paste this URL when doing the following `git clone` command.
16
+
Fork the repository by clicking the 'Fork' button on the top right. After the fork completes, the page will be redirected to the forked repository.
17
17
18
-
On your computer, follow these steps to setup a local repository for working on ZStack:
18
+
Please follow below steps to setup a local ZStack repository:
It is important that you create a new branch to make changes on and that you do not change the `master` branch (other than to rebase in changes from `upstream/master`). In this example I will assume you will be making your changes to a branch called `feature_x`. This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the ZStack project.
33
+
You need to create a new branch to make changes, and do not directly change the `master` branch. In the following example, We assume you are going to make changes to a branch `feature_x`, which is created in your local repository and will be pushed to the remote forked repository later. Once the branch is pushed, you can create a Pull Request to the ZStack project.
34
34
35
-
It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch.
35
+
The best practice is to create a new branch each time you want to contribute a patch and only track the changes for that pull request in the branch.
36
36
37
37
```bash
38
38
$ git checkout -b feature_x
@@ -42,19 +42,19 @@ $ git add .
42
42
$ git commit -a -m "descriptive commit message for your changes"
43
43
```
44
44
45
-
> The `-b`specifies that you want to create a new branch called `feature_x`. You only specify `-b`the first time you checkout because you are creating a new branch. Once the `feature_x` branch exists, you can later switch to it with only `git checkout feature_x`.
45
+
> The `-b`is for creating the new branch `feature_x`; it's used the first time you create a new branch.
46
46
47
47
48
48
Rebase `feature_x` to include updates from `upstream/master`
It is important that you maintain an up-to-date `master` branch in your local repository. This is done by rebasing in the code changes from `upstream/master` (the official ZStack project repository) into your local repository. You will want to do this before you start working on a feature as well as right before you submit your changes as a pull request. I recommend you do this process periodically while you work to make sure you are working off the most recent project code.
51
+
It's important to use `git rebase` to keep an up-to-date `master` branch in your local repository. You need to do this before starting to work on a new feature or making a pull request.
52
52
53
-
This process will do the following:
53
+
This process is like:
54
54
55
-
1.Checkout your local `master` branch
56
-
2. Synchronize your local `master` branch with the `upstream/master` so you have all the latest changes from the project
57
-
3. Rebase the latest project code into your`feature_x` branch so it is up-to-date with the upstream code
55
+
1.Check out to your local `master` branch
56
+
2. Synchronize the local `master` branch with the `upstream/master` so it has the latest changes
57
+
3. Rebase the latest changes into the`feature_x` branch to make it up-to-date
58
58
59
59
```bash
60
60
$ git checkout master
@@ -64,31 +64,29 @@ $ git checkout feature_x
64
64
$ git rebase master
65
65
```
66
66
67
-
> Now your `feature_x` branch is up-to-date with all the code in `upstream/master`.
67
+
> Now your `feature_x` branch is up-to-date with `upstream/master`.
68
68
69
69
70
-
Make a GitHub Pull Request to contribute your changes
When you are happy with your changes and you are ready to contribute them, you will create a Pull Request on GitHub to do so. This is done by pushing your local changes to your forked repository (default remote name is `origin`) and then initiating a pull request on GitHub.
73
+
Now you are ready to make a pull request. This is done by pushing your local changes to your remote forked repository (default remote name is `origin`) and then initiating a pull request on GitHub.
74
74
75
-
> **IMPORTANT:** Make sure you have rebased your `feature_x` branch to include the latest code from `upstream/master`_before_ you do this.
75
+
> **IMPORTANT:** Make sure you have followed the above chapter to make the `feature_x` branch up-to-date.
76
76
77
77
```bash
78
78
$ git push origin master
79
79
$ git push origin feature_x
80
80
```
81
81
82
-
Now that the `feature_x` branch has been pushed to your GitHub repository, you can initiate the pull request.
82
+
To initiate the pull request, do following:
83
83
84
-
To initiate the pull request, do the following:
84
+
1. Open your forked repository: [https://github.com/YOUR_ACCOUNT/zstack](https://github.com/YOUR_ACCOUNT/zstack)
85
+
2. Click the new button '**Compare & pull request**'
86
+
3. Validate the destination is `master` branch of ZStack and the source branch is your `feature_x` branch
87
+
4. Enter a detailed description and click the button '**Send pull request**'
85
88
86
-
1. In your browser, navigate to your forked repository: [https://github.com/YOUR_ACCOUNT/zstack](https://github.com/YOUR_ACCOUNT/zstack)
87
-
2. Click the new button called '**Compare & pull request**' that showed up just above the main area in your forked repository
88
-
3. Validate the pull request will be into the upstream `master` and will be from your `feature_x` branch
89
-
4. Enter a detailed description of the work you have done and then click '**Send pull request**'
90
-
91
-
If you are requested to make modifications to your proposed changes, make the changes locally on your `feature_x` branch, re-push the `feature_x` branch to your fork. The existing pull request should automatically pick up the change and update accordingly.
89
+
If you are requested to make modifications to your proposed changes, make the changes locally on your `feature_x` branch, re-push the `feature_x` branch to your fork. The existing pull request should automatically pick up the change.
0 commit comments