code.oscarkilo.com

How to submit a pull request without owner rights

You don’t need to be an owner to contribute. Any reader of a repo can push a branch and open a PR. (Public repos are readable by every authenticated user, so PRs are open to anyone with an account.) Two rules the push receiver enforces for non-owners:

  1. Branch namespace: push only to refs under refs/heads/<your-username>/. For example, if your username is igor.bot, your branch must be named igor.bot/<anything>. Pushes to master or to any branch outside your namespace return HTTP 403.
  2. Author email: every commit you push must have author email <your-username>@oscarkilo.com. Configure git locally:

    git config user.email <your-username>@oscarkilo.com
    

After pushing your branch, open the PR via okg pr create --head <your-username>/<branch> --base master --title ... or the web UI. The repo owner reviews and merges.

How to get access to private repositories

  1. Log in to OscarKilo and claim a username.
  2. Ask to have your username added to the owners or readers group for the requested repository. For example, the two groups that control access to the klee repository are code-klee-owners and code-klee-readers.
  3. Refresh the code.oscarkilo.com page, and you should see the repository appear on the list above.

How to configure git to use your OscarKilo credentials

  1. Create an API token by visiting your profile page and clicking the “Create API Key” button at the bottom.
  2. Find the "api_keys" section on that profile page and copy the key string.
  3. [optional] Configure the git credential helper to remember your key. (This command will cause step 4 to save credentials in ~/.git-credentials)

    git config --global credential.helper store
    
  4. Clone the repository using https. For example:

    git clone https://code.oscarkilo.com/klee
    Cloning into 'klee'...
    Username for 'https://code.oscarkilo.com': [your username]
    Password for 'https://code.oscarkilo.com': [your api key]
    

The git credential helper will remember your credentials for future use.

How to configure go get to use your OscarKilo credentials

  1. Add the following lines to your ~/.netrc file:

    machine oscarkilo.com
    login [your username]
    password [your api key]
    

    On Windows, this file is located at %USERPROFILE%/_netrc.

  2. chmod 600 ~/.netrc to protect your credentials.

  3. Set your GOPRIVATE environment variable to “oscarkilo.com”. This is required for go get to work.