# Create a new file

Creating and adding new files to your repository is an integral part of updating your project's content.

Follow these steps to add a file to your repository on Protocol.Land:

1. Navigate to the main page of the repository and click “Add file” located on the top-left corner above the list of files.\
   ![](/files/gZQONuYMv1f19ta8FvfO)
2. Click “Create new file” from the modal you are prompted with.\
   ![](/files/dfgX0D3UW0hLgEgivY6U)
3. You will be redirected to the file creation page.
4. Type in the desired file name along with its extension in the provided input field. You can also provide a path along with the file name like \`folder/filename.ext\` to create folders within the repository.\
   ![](/files/gANbjTUR7ipmj4SWG3Ld)

{% hint style="info" %}
Note: The files and folders are created relative to the file path you click the “Create new file” in. If a folder already exists, it will simply add the file to it based on the provided path.
{% endhint %}

5. Type in your code in the provided code editor.
6. After making the changes, you have the option to “Cancel Changes” or “Commit Changes” to the active branch.\
   ![](/files/MlGRir99qO7NxPG72Q5P)
7. Click “Commit Changes”.
8. A modal will prompt you to add a commit message.\
   ![](/files/MCn6bNIR7VyH7hON1gzG)
9. Type in the desired commit message that summarizes the changes.
10. Preview the estimated cost of committing your changes by hovering over the information icon.
11. Click “Commit changes”.
12. You will be redirected to the main page of the repository, where the updated files list of the active branch will now include the newly created file.


---

# Agent Instructions: 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:

```
GET https://docs.protocol.land/working-with-files/create-a-new-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
