Skip to content

Development with your fork

jchappelow edited this page May 24, 2024 · 4 revisions

It is encouraged for all contributors to submit pull requests (PRs) from their own fork of the repository.

  • Clone a git the official kwil-db repository in a local git workspace on your machine

    git clone https://github.com/kwilteam/kwil-db
    cd kwil-db
    git remote -v # display the configured remotes

    This will create a git workspace folder where the one "remote" is called origin and points to the official repository:

    origin	https://github.com/kwilteam/kwil-db.git (fetch)
    origin	https://github.com/kwilteam/kwil-db.git (push)
  • From the "Code" page at https://github.com/kwilteam/kwil-db, click the "Fork" button (or this link) if you have not already.

  • After creating your fork, go to it's GitHub page (for example "https://github.com/jchappelow/kwil-db" for the user name "jchappelow"), and click the "Code" button and copy the desired link. SSH is recommended.

  • Add your remote to the git workspace. For example, for the user name jchappelow:

    git remote add jchappelow [email protected]:jchappelow/kwil-db

You will now have two remotes:

```sh
$  git remote -v
jchappelow	[email protected]:jchappelow/kwil-db (fetch)
jchappelow	[email protected]:jchappelow/kwil-db (push)
origin	https://github.com/kwilteam/kwil-db.git (fetch)
origin	https://github.com/kwilteam/kwil-db.git (push)
```

The main branch should be tracking the official repository's branch:

```
$ git checkout main
Already on 'main'
Your branch is up to date with 'origin/main'.

$ git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
```
  • When preparing a change for a PR, create a branch, and push it to your remote.

    $ git checkout main # sync with kwilteam/kwil-db main
    $ git pull
    $ git checkout -b my-fix

Make some changes, add some files (use git add -u for change and git add path/to/files for new files).

```sh
$ git add -u # stage changed files
$ git add newfile.md # explicitly add files you want added
$ git commit -m "docs: making some docs changes yall"
```

Push the branc to your remote:

```sh
$  git push -u jchappelow my-fix
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote: 
remote: Create a pull request for 'my-fix' on GitHub by visiting:
remote:      https://github.com/jchappelow/kwil-db/pull/new/my-fix
remote: 
To github.com:jchappelow/kwil-db
 * [new branch]      my-fix -> my-fix
Branch 'my-fix' set up to track remote branch 'my-fix' from 'jchappelow'.
```