diff --git a/docs/help/contribute/010_PULL_REQUEST.md b/docs/help/contribute/010_PULL_REQUEST.md new file mode 100644 index 0000000000..129df49349 --- /dev/null +++ b/docs/help/contribute/010_PULL_REQUEST.md @@ -0,0 +1,133 @@ +--- +title: Pull Requests +--- + +## pre-requirements + +To follow the steps in this tutorial you will need: + +- [GitHub](https://github.com) account +- [git](https://git-scm.com/downloads) source controll +- Text / Code Editor (personally I preffer + [Visual Studio Code](https://code.visualstudio.com/Download)) +- Terminal: + - If you are on Linux/MacOS you can use bash or zsh + - for Windows Users the commands are written for PowerShell + +## Fork Repository + +The first step to be done if you want to contribute to InvokeAI, is to fork the +rpeository. + +Since you are already reading this doc, the easiest way to do so is by clicking +[here](https://github.com/invoke-ai/InvokeAI/fork). You could also open +[InvokeAI](https://github.com/invoke-ai/InvoekAI) and click on the "Fork" Button +in the top right. + +## Clone your fork + +After you forked the Repository, you should clone it to your dev machine: + +=== "Linux:fontawesome-brands-linux: / MacOS:simple-apple:" + + ``` sh + git clone https://github.com//InvokeAI \ + && cd InvokeAI + ``` + +=== "Windows:fontawesome-brands-windows:" + + ``` powershell + git clone https://github.com//InvokeAI ` + && cd InvokeAI + ``` + +## Install in Editable Mode + +To install InvokeAI in editable mode, (as always) we recommend to create and +activate a venv first. Afterwards you can install the InvokeAI Package, +including dev and docs extras in editable mode, follwed by the installation of +the pre-commit hook: + +=== "Linux:fontawesome-brands-linux: / MacOS:simple-apple:" + + ``` sh + python -m venv .venv \ + --prompt InvokeAI \ + --upgrade-deps \ + && source .venv/bin/activate \ + && pip install \ + --upgrade-deps \ + --use-pep517 \ + --editable=".[dev,docs]" \ + && pre-commit install + ``` + +=== "Windows:fontawesome-brands-windows:" + + ``` powershell + python -m venv .venv ` + --prompt InvokeAI ` + --upgrade-deps ` + && .venv/scripts/activate.ps1 ` + && pip install ` + --upgrade ` + --use-pep517 ` + --editable=".[dev,docs]" ` + && pre-commit install + ``` + +## Create a branch + +Make sure you are on main branch, from there create your feature branch: + +=== "Linux:fontawesome-brands-linux: / MacOS:simple-apple:" + + ``` sh + git checkout main \ + && git pull \ + && git checkout -B + ``` + +=== "Windows:fontawesome-brands-windows:" + + ``` powershell + git checkout main ` + && git pull ` + && git checkout -B + ``` + +## Commit your changes + +When you are done with adding / updating content, you need to commit those +changes to your repository before you can actually open an PR: + +```{ .sh .annotate } +git add # (1)! +git commit -m "A commit message which describes your change" +git push +``` + +1. Replace this with a space seperated list of the files you changed, like: + `README.md foo.sh bar.json baz` + +## Create a Pull Request + +After pushing your changes, you are ready to create a Pull Request. just head +over to your fork on [GitHub](https://github.com), which should already show you +a message that there have been recent changes on your feature branch and a green +button which you could use to create the PR. + +The default target for your PRs would be the main branch of +[invoke-ai/InvokeAI](https://github.com/invoke-ai/InvokeAI) + +Another way would be to create it in VS-Code or via the GitHub CLI (or even via +the GitHub CLI in a VS-Code Terminal Window 🤭): + +```sh +gh pr create +``` + +The CLI will inform you if there are still unpushed commits on your branch. It +will also prompt you for things like the the Title and the Body (Description) if +you did not already pass them as arguments. diff --git a/docs/help/contribute/index.md b/docs/help/contribute/index.md new file mode 100644 index 0000000000..19189b3104 --- /dev/null +++ b/docs/help/contribute/index.md @@ -0,0 +1,10 @@ +--- +title: Contribute +--- + +There are different ways how you can contribute to +[InvokeAI](https://github.com/invoke-ai/InvokeAI), like Translations, opening +Issues for Bugs or ideas how to improve. + +This Section of the docs will explain some of the different ways of how you can +contribute to make it easier for newcommers as well as advanced users :nerd: