| title | Creating new files | ||||||
|---|---|---|---|---|---|---|---|
| intro | You can create new files directly on {% data variables.product.github %} in any repository you have write access to. | ||||||
| redirect_from |
|
||||||
| versions |
|
||||||
| category |
|
When creating a file on {% data variables.product.github %}, consider the following:
- If you try to create a new file in a repository that you don’t have access to, we will fork the project to your personal account and help you send a pull request to the original repository after you commit your change.
- File names created via the web interface can only contain alphanumeric characters and hyphens (
-). To use other characters, create and commit the files locally, then push them to the repository on {% data variables.product.github %}. {%- ifversion push-rulesets %} - {% data reusables.repositories.rulesets-push-rules-general-info-for-related-articles %} {% endif %}
{% data reusables.repositories.sensitive-info-warning %}
{% data reusables.repositories.navigate-to-repo %}
- In your repository, browse to the folder where you want to create a file. {% data reusables.files.add-file %}
- In the file name field, type the name and extension for the file. To create subdirectories, type the
/directory separator. - In the file contents text box, type content for the file.
- To review the new content, above the file contents, click Preview.

{% data reusables.files.write_commit_message %} {% data reusables.files.choose-commit-email %} {% data reusables.files.choose_commit_branch %} {% data reusables.files.propose_new_file %}