# How to Push to Main Branch in Github

> To push to the main branch in GitHub, navigate to your repository, add and create a new file, and enter your file content. Next, enter a commit message, select the option to commit directly to the main branch, click commit changes, and verify your files appear on the repository's main page.

Canonical: https://livedemo.ai/tutorials/how-to-push-to-main-branch-in-github/
Apps: GitHub
Updated: 2026-10-05
Interactive demo: https://story-api.livedemo.ai/workspaces/62255d3d3304f17b8f5e2d03/stories/692a4b58ab56e05a00ff6b71/preview?step=1

## Steps

1. Navigate to your desired repository.
2. Select 'Add files'.
3. Select 'Create files'.
4. Name your file and add your file content.
5. Click 'Commit changes'.
6. Enter a 'commit message' that describes your changes.
7. Optionally, add a more detailed description in the provided field.
8. Make sure the option "Commit directly to the main branch" is selected.
9. Click "Commit changes" to push your changes directly to the main branch.
10. Go back to your repository’s main page and ensure your files or changes appear as expected.
