diff options
| author | Jianfei Hu <jianfeih@google.com> | 2018-12-07 11:06:44 -0800 |
|---|---|---|
| committer | Jianfei Hu <jianfeih@google.com> | 2018-12-07 11:06:44 -0800 |
| commit | 1b775253d3a0311c06da75f19334d25f5a35e174 (patch) | |
| tree | ba3b5c5a1ef60a5b92694f8f9ee7a9de45183ed6 /contributors/guide/github-workflow.md | |
| parent | 7980908c2ff41bc78836e628fa0c903ea4b3587f (diff) | |
| parent | 6ac21ab4d415a459397f5cd2e6abd7b60ccac374 (diff) | |
Merge branch 'master' of https://github.com/kubernetes/community into patch-2
Diffstat (limited to 'contributors/guide/github-workflow.md')
| -rw-r--r-- | contributors/guide/github-workflow.md | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/contributors/guide/github-workflow.md b/contributors/guide/github-workflow.md index a1429258..221a7921 100644 --- a/contributors/guide/github-workflow.md +++ b/contributors/guide/github-workflow.md @@ -74,6 +74,22 @@ git checkout -b myfeature Then edit code on the `myfeature` branch. #### Build +The following section is a quick start on how to build Kubernetes locally, for more detailed information you can see [kubernetes/build](https://git.k8s.io/kubernetes/build/README.md). +The best way to validate your current setup is to build a small part of Kubernetes. This way you can address issues without waiting for the full build to complete. To build a specific part of Kubernetes use the `WHAT` environment variable to let the build scripts know you want to build only a certain package/executable. + +```sh +make WHAT=cmd/{$package_you_want} +``` + +*Note:* This applies to all top level folders under kubernetes/cmd. + +So for the cli, you can run: + +```sh +make WHAT=cmd/kubectl +``` + +If everything checks out you will have an executable in the `_output/bin` directory to play around with. *Note:* If you are using `CDPATH`, you must either start it with a leading colon, or unset the variable. The make rules and scripts to build require the current directory to come first on the CD search path in order to properly navigate between directories. @@ -235,3 +251,47 @@ git rebase -i upstream/master For mass automated fixups (e.g. automated doc formatting), use one or more commits for the changes to tooling and a final commit to apply the fixup en masse. This makes reviews easier. + +### Reverting a commit + +In case you wish to revert a commit, use the following instructions. + +_If you have upstream write access_, please refrain from using the +`Revert` button in the GitHub UI for creating the PR, because GitHub +will create the PR branch inside the main repository rather than inside your fork. + +1. Create a branch and sync it with upstream. + +```sh +# create a branch +git checkout -b myrevert + +# sync the branch with upstream +git fetch upstream +git rebase upstream/master +``` + +2. If the commit you wish to revert is a: + +- merge commit: + +```sh +# SHA is the hash of the merge commit you wish to revert +git revert -m 1 SHA +``` + +- single commit: + +```sh +# SHA is the hash of the single commit you wish to revert +git revert SHA +``` + +3. This will create a new commit reverting the changes. +Push this new commit to your remote. + +```sh +git push ${your_remote_name} myrevert +``` + +4. [Create a Pull Request](#7-create-a-pull-request) using this branch. |
