---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.3
alternate:
  - https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/add-file-repo.md
  - https://sourcecraft.dev/portal/docs/ru/sourcecraft/operations/add-file-repo.md
  - href: en/sourcecraft/operations/add-file-repo.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

# Adding a file or directory to a repository from the SourceCraft interface

In the SourceCraft UI, you can [create](#create) a new file or directory without cloning the repository, as well as [upload](#upload) a file from your local PC.

## Creating a file or directory {#create}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, navigate to ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace** → ![image](../../_assets/console-icons/archive.svg) **Repositories**.
1. Select the repository with the code you need to edit.
1. Under ![image](../../_assets/console-icons/code.svg) **Code** on the repository page, go to ![image](../../_assets/console-icons/archive.svg) **Overview**.
1. Select the branch for editing.
1. Above the list of files in the branch, click ![image](../../_assets/console-icons/plus.svg) **New**.
1. Select ![image](../../_assets/console-icons/file.svg) **File** or ![image](../../_assets/console-icons/folder.svg) **Directory**.
1. In the window that opens, enter a file or directory name and click **Create file** or **Create directory** respectively.
1. To save your changes:

    <!-- source: en/_includes/sourcecraft/commit-message.md -->
    1. In the top-right corner, click **Commit changes**.
    1. In the window that opens, configure the procedure for changes:

        <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
        * In the **Commit message** field, give a comment that will describe the changes you make.
        * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
        * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
        <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

    1. Confirm your changes.
    <!-- endsource: en/_includes/sourcecraft/commit-message.md -->

## Uploading a file from your local PC {#upload}

1. Open the SourceCraft [home page](https://sourcecraft.dev).
1. On the ![image](../../_assets/console-icons/house.svg) **Home** tab, navigate to ![image](../../_assets/console-icons/layout-tabs.svg) **Your craftspace** → ![image](../../_assets/console-icons/archive.svg) **Repositories**.
1. Select the repository you want to upload your file into.
1. Under ![image](../../_assets/console-icons/code.svg) **Code** on the repository page, go to ![image](../../_assets/console-icons/archive.svg) **Overview**.
1. Select the branch you want to upload the file to.
1. Above the list of files, click ![image](../../_assets/console-icons/plus.svg) **New** and select ![image](../../_assets/console-icons/cloud-arrow-up-in.svg) **Upload file**.
1. In the window that opens, select a file on your local PC.
1. Configure the settings for saving changes:

    <!-- source: en/_includes/sourcecraft/commit-message-settings.md -->
    * In the **Commit message** field, give a comment that will describe the changes you make.
    * Under **Commit branch**, select the branch you want to change. Create a new branch as needed.
    * Under **After commit action**, select an action to take after saving changes: `Save and create a new change proposal` or `Just save`.
    <!-- endsource: en/_includes/sourcecraft/commit-message-settings.md -->

1. Confirm your changes.

#### Useful links {#see-also}

* [Deleting, renaming, or moving a file or folder in a SourceCraft repository with Git](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/file-management.md)
* [Editing code in SourceCraft Code Assistant](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/code-edit.md)
* [Navigating and searching by code in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/code-navigation.md)
* [Downloading, copying, or getting a link to a raw file in SourceCraft](https://sourcecraft.dev/portal/docs/en/sourcecraft/operations/raw-content.md)
