knative.dev/pkg@v0.0.0-20260602142205-ac97e43f6622/DEVELOPMENT.md (about)

     1  # Development
     2  
     3  This doc explains how to setup a development environment so you can get started
     4  [contributing](https://knative.dev/community/contributing/) to Knative `pkg`.
     5  Also take a look at:
     6  
     7  - [The pull request workflow](https://knative.dev/community/contributing/reviewing/)
     8  
     9  ## Getting started
    10  
    11  1. Create [a GitHub account](https://github.com/join)
    12  1. Setup
    13     [GitHub access via SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
    14  1. Install [requirements](#requirements)
    15  1. Set up your [shell environment](#environment-setup)
    16  1. [Create and checkout a repo fork](#checkout-your-fork)
    17  
    18  Before submitting a PR, see also [CONTRIBUTING.md](./CONTRIBUTING.md).
    19  
    20  ### Requirements
    21  
    22  You must install these tools:
    23  
    24  1. [`go`](https://golang.org/doc/install): The language Knative `pkg` is built
    25     in
    26  1. [`git`](https://help.github.com/articles/set-up-git/): For source control
    27  
    28  ### Environment setup
    29  
    30  To get started you'll need to set these environment variables (we recommend
    31  adding them to your `.bashrc`):
    32  
    33  1. `GOPATH`: If you don't have one, simply pick a directory and add
    34     `export GOPATH=...`
    35  1. `$GOPATH/bin` on `PATH`: This is so that tooling installed via `go get` will
    36     work properly.
    37  
    38  `.bashrc` example:
    39  
    40  ```shell
    41  export GOPATH="$HOME/go"
    42  export PATH="${PATH}:${GOPATH}/bin"
    43  ```
    44  
    45  ### Checkout your fork
    46  
    47  The Go tools require that you clone the repository to the `src/knative.dev/pkg`
    48  directory in your [`GOPATH`](https://github.com/golang/go/wiki/SettingGOPATH).
    49  
    50  To check out this repository:
    51  
    52  1. Create your own
    53     [fork of this repo](https://help.github.com/articles/fork-a-repo/)
    54  1. Clone it to your machine:
    55  
    56  ```shell
    57  mkdir -p ${GOPATH}/src/knative.dev
    58  cd ${GOPATH}/src/knative.dev
    59  git clone git@github.com:${YOUR_GITHUB_USERNAME}/pkg.git
    60  cd pkg
    61  git remote add upstream https://github.com/knative/pkg.git
    62  git remote set-url --push upstream no_push
    63  ```
    64  
    65  _Adding the `upstream` remote sets you up nicely for regularly
    66  [syncing your fork](https://help.github.com/articles/syncing-a-fork/)._
    67  
    68  Once you reach this point you are ready to do a full build and deploy as
    69  described below.