> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit an article

> How to fork the repository, make edits locally, preview your changes, and open a pull request.

## Pre-requisites

1. [Get SuperOfficeDocs running locally][1]: To edit an article, you need to get SuperOfficeDocs running locally on your machine.

2. **Markdown**: Docs uses markdown syntax to format content. Markdown is simple to pick up on. Familiarize yourself with the [Markdown guide][2] before making updates to content.

Now that you've gotten SuperOfficeDocs running locally (congrats BTW!), we will talk through the steps for making an edit, previewing the edit, pushing it to your forked repo, then creating a pull request.

## How to edit and preview content

1. Fork the [SuperOfficeDocs repo][3] into your own repo.

   ![Fork SuperOfficeDocs screenshot][img1]

2. Set your remote repositories. We will use the terms **upstream** and **origin**. When you originally cloned the repo (in the pre-requisites), the `origin` was added for you implicitly.

   Type `git remote add upstream https://github.com/SuperOfficeDocs/docs` to add the main SuperOffice Docs repo as your upstream repo.

   <Note>
     Remotes can be named anything you like. Find out your remotes by typing `git remote -v`.
   </Note>

   Type `git remote -v` to list your remotes. If you are new to Git, you should have 2 remotes:

   * `origin` is your forked repo
   * `upstream` is the main SuperOfficeDocs repo

3. Create an [issue][4] on GitHub that corresponds with the edit you're working on by clicking the **New Issue** button in the browser. Be sure to include relevant information providing context to the issue in the description or comment section. This helps reviewers understand what you're working on.

   Make note of the **issue number** that GitHub generates.

   ![GitHub issue screenshot][img2]

4. Create a new branch for your work. Branch names start with the issue number, for ease of tracking.

   **Example branch name**: `107-fix-broken-link`

   **Example Git command to create new branch**: `git switch -c 107-fix-broken-link`

5. Make your edits.

6. Preview your work locally by running `mint dev` in your terminal (in VS Code, PowerShell, or similar). This will run SuperOfficeDocs locally on your machine at a URL similar to this `localhost:3000`. Click the link or copy and paste it into your browser.

When you are happy with your changes, you can move on to pushing it to your forked repo and creating a pull request.

## How to commit and share

1. Use `git status` to review the files you are working on and ensure the proper files are being tracked.

2. Use `git add [INSERT FILE NAME]` to stage a single file or `git add .` to stage **all** modified files to be committed.

3. Use `git commit -m "[INSERT YOUR COMMIT MESSAGE HERE] (#[INSERT ISSUE NUMBER HERE])"` to commit your files. The `-m` stands for *message*. Replace the placeholders with a brief, relevant summary and your issue number - end the message with the issue ID in parentheses, so GitHub links it automatically.

4. Use `git push origin [INSERT A NEW BRANCH NAME HERE]` to push your updated files to your repo. Replace the *INSERT A NEW BRANCH NAME HERE* with the name of your new branch.

5. Go to your forked GitHub repo on GitHub.com. GitHub should detect the updated code and prompt you to make a pull request.

6. Create a pull request by clicking the **Compare and create pull request** button. In the description or comments section be sure to include the text "Resolves `#[INSERT ISSUE NUMBER HERE]` where your previously created issue number is associated with this pull request.

<Note>
  A preview link normally appears automatically as a bot comment shortly after you open the pull request - except a pull request from a fork does not get one. See [Manual (custom) previews][6] to request one instead.
</Note>

<Tip>
  Want more info on Git? Check out the free, online [GitBook][5].
</Tip>

[1]: ./getting-started

[2]: ./markdown-guide/index

[3]: https://github.com/SuperOfficeDocs/docs

[4]: https://github.com/SuperOfficeDocs/docs/issues

[5]: https://git-scm.com/book/en/v2

[6]: ./deployment#manual-previews

[img1]: /media/loc/en/contribute/fork-repo-on-github.png

[img2]: /media/loc/en/contribute/create-issue-on-github.png
