mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-22 21:41:39 +01:00
Add dev git env section
This commit is contained in:
parent
7c0e2cdfe5
commit
9138763eef
@ -320,6 +320,63 @@ Finally, for documentation changes go to your esphome-docs folder, and install s
|
||||
Or alternatively just submit a draft PR to the docs repo and wait for netlify to create
|
||||
a build preview.
|
||||
|
||||
Setting Up Git Environment
|
||||
--------------------------
|
||||
|
||||
ESPHome's code-base is hosted on GitHub, and contributing is done exclusively through
|
||||
"Pull Requests" (PRs) in the GitHub interface. So you need to set up your git environment
|
||||
first.
|
||||
|
||||
When you want to create a patch for ESPHome, first go to the repository you want to contribute to
|
||||
(esphome, esphome-core, etc) and click fork in the top right corner. This will create
|
||||
a fork of the repository that you can modify and create git branches on.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Clone your fork
|
||||
git clone https://github.com/<YOUR_GITHUB_USERNAME>/<REPO_NAME>.git
|
||||
# For example: git clone https://github.com/OttoWinter/esphome-core.git
|
||||
|
||||
# Add "upstream" remote
|
||||
git remote add upstream https://github.com/esphome/<REPO_NAME>.git
|
||||
# For example: git clone https://github.com/esphome/esphome-core.git
|
||||
|
||||
# For each patch, create a new branch from latest dev
|
||||
git checkout dev
|
||||
git pull upstream dev
|
||||
git checkout -b <MY_NEW_FEATURE>
|
||||
# For example: git checkout -b gpio-switch-fix
|
||||
|
||||
# Make your modifications, then commit changes with message describing changes
|
||||
git add .
|
||||
git commit -m "<COMMIT_MESSAGE>"
|
||||
# For example: git commit -m "Fix GPIO Switch Not Turning Off Interlocked Switches"
|
||||
|
||||
# Upload changes
|
||||
git push -u origin <BRANCH_NAME>
|
||||
# For example: git push -u origin gpio-switch-fix
|
||||
|
||||
Then go to your repository fork in GitHub and wait for a create pull request message to show
|
||||
up in the top (alternatively go to branches and create it from there). Fill out the
|
||||
Pull Request template outlining your changes; if your PR is not ready to merge yet please
|
||||
mark it as a draft PR in the dropdown of the green "create PR" button.
|
||||
|
||||
**Review Process:** ESPHome's code base tries to have a high code standard. At the bottom
|
||||
of the Pull Request you will be able to see the "Travis" continuous integration check which
|
||||
will automatically go through your patch and try to spot errors. If the CI check fails,
|
||||
please see the travis log and fix all errors that appear there. Only PRs that pass the automated
|
||||
checks can be merged!
|
||||
|
||||
**Catching up with reality**: Sometimes other commits have been made to the same files
|
||||
you edited. Then your changes need to be re-applied on top of the latest changes with
|
||||
a "rebase". More info `here <https://developers.home-assistant.io/docs/en/development_catching_up.html>`__.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Fetch the latest upstream changes and apply them
|
||||
git fetch upstream dev
|
||||
git rebase upstream/dev
|
||||
|
||||
Contributing to ESPHome-Core
|
||||
----------------------------
|
||||
|
||||
|
@ -159,8 +159,19 @@ To install the dev version of ESPHome:
|
||||
- In Hass.io: In the ESPHome add-on repository there's also a second add-on called ``ESPHome Dev``.
|
||||
Install that and stop the stable version (both can't run at the same time without port collisions).
|
||||
- From ``pip``: Run ``pip install https://github.com/esphome/esphome/archive/dev.zip``
|
||||
- From docker: Run ``docker pull esphome/esphome:dev`` and use ``esphome/esphome:dev`` in all
|
||||
commands.
|
||||
- From docker, you need to build the docker image yourself (automated dev builds are not possible
|
||||
due to docker hubs limited build quota)
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git clone https://github.com/esphome/esphome.git
|
||||
cd esphome
|
||||
docker build -t esphome-dev -f docker/Dockerfile .
|
||||
docker run [...] -it esphome-dev livingroom.yaml compile
|
||||
|
||||
# Update image and rebuild
|
||||
git pull
|
||||
docker build -t esphome-dev -f docker/Dockerfile .
|
||||
|
||||
The latest dev docs are here: `next.esphome.io <https://next.esphome.io/>`__
|
||||
|
||||
@ -181,7 +192,7 @@ Sure! I'd be happy to help :) You can contact me here:
|
||||
- ESPHome `issue <https://github.com/esphome/issues>`__ and
|
||||
`feature request <https://github.com/esphome/feature-requests>`__ issue trackers. Preferably only for issues and
|
||||
feature requests.
|
||||
- Alternatively, also under contact (at) esphome.io
|
||||
- Alternatively, also under contact (at) esphome.io (NO SUPPORT!)
|
||||
|
||||
.. _wifi-problems:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user