> For the complete documentation index, see [llms.txt](https://engine.sygnal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://engine.sygnal.com/setup/advanced-install-notes/add-sse-to-an-existing-repo.md).

# Add SSE to an Existing Repo

This is an uncommon scenario, but suppose;

* You already have a Github repo for this site
* It's already Typescript-based, or contains other unrelated content like CSS and data
* You want to "convert" it to an SSE repo&#x20;

In this scenario you can "merge" SSE's template repo into your current repo, resolve any conflicts, and then gradually refactor your existing code into SSE's infrastructure.&#x20;

1. **Open the Terminal in Your Codespace**.
2. **Add the Remote Repository**: (If you haven't done this already)

   <pre class="language-sh" data-overflow="wrap"><code class="lang-sh">git remote add template-repo https://github.com/sygnaltech/sse-template.git
   </code></pre>
3. **Fetch the Remote Repository**:

   ```sh
   git fetch template-repo
   ```
4. **Merge with the `--allow-unrelated-histories` Flag**:

   ```sh
   git merge template-repo/main --allow-unrelated-histories
   ```
5. **Resolve Any Conflicts**: If there are merge conflicts, use VS Code's merge conflict resolution tools to resolve them.
6. **Commit and Push Changes**:

   ```sh
   git add .
   git commit -m "Merged template repository into current repository with unrelated histories"
   git push origin main
   ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://engine.sygnal.com/setup/advanced-install-notes/add-sse-to-an-existing-repo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
