Instructions for contributing to Stitch Docs.
Prerequisites
You have installed a code editor, such as VSCode or Sublime Text.
You have cloned the Stitch Docs repository. To be able to create a branch and merge your changes to master, you should be in the Tech Docs team.
Step 1: Create a new branch
To edit Stitch Docs, you first need to create a new branch in the repository. If you are using GitHub Desktop:
- Click Branch>New branch.
- Enter a name for your branch.
- Make sure to create the branch from
master
. - Click Create branch.
If you are using a command line, make sure you are on the master branch and use the following command:
git branch your_branch_name
Once the branch is created, you can start editing content.
Step 2: Commit and push changes
Once you have made your changes to the Stitch Docs, you can commit and push them. If you are using GitHub Desktop:
- Click Fetch origin to make sure your branch is up to date.
- In the Summary field, enter a commit message.
- Click Commit.
- Click Push origin.
If you are using a command line:
- Pull the latest updates on the branch with
git pull
. - Stage your changes with
git add
. To add all modified files, usegit add -A
, otherwise, usegit add file_name
. - Commit your changes with
git commit -m "commit message"
. - Push your changes with
git push
.
Step 3: Create a pull request
If you go to the repository on GitHub after pushing your changes, you should see a message that looks like this:
- Click Compare & pull request.
- Enter a title and a description if needed, then click Create pull request.
The pull request is created and the checks start running.
Step 4: Preview your changes
Once a pull request is created on the stitch-docs
repository, a Netlify action runs to publish a preview of your changes. To access it:
- Open your PR on GitHub, scroll down to the section about checks and click Show all checks.
- Click Details next to the deploy/netlify.
You will get a
Page Not Found
, this is a known issue. - To access the preview, add
/docs
at the end of the URL.
Step 5: Merge a pull request
Once all checks have passed and the content you added is validated, you can merge your PR. If you are an administrator of the repository, you can merge without a review.
Note: Once a pull request is merged to master
, Netlify automatically redeploys the site, so make sure that everything is in a publishable state before merging.
-
Click Squash and merge or Merge pull request.
The Squash and merge option creates a single commit from the changes in the source branch, while the Merge pull request options adds all individual commits to the target branch.
-
If the pull request has no reviews, select the Use your adminitrator privileges to merge this pull request check box and click Confirm merge.
Step 6: Follow the Netlify deployment
After merging your PR, you can go to Netlify to follow the deployment of the Stitch Docs site.
- Go to the Stitch Docs overview on Netlify.
- In the Production deploys section, click the deployment that matches your PR.
In the Deploy log, you can see the status of the deployment. Once it is finished, you can check your changes on Stitch Docs.
Back to top
Last updated: 22 February 2022