Web Editor

You can use the Web Editor to make changes to a single file directly from the GitLab UI. To make changes to multiple files, see Web IDE.

In the Web Editor, you can:

Your primary email address is used by default for any change you commit through the Web Editor.

Create a file

To create a text file in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. From the project dashboard or repository, next to the branch name, select the plus icon ().
  3. From the dropdown list, select New file.
  4. Complete the fields.
  5. To create a merge request with the new file, ensure the Start a new merge request with these changes checkbox is selected, if you had chosen a Target branch other than the default branch (such as main).
  6. Select Commit changes.

Create a file from a template

  1. On the left sidebar, select Search or go to and find your project.
  2. Select Code > Repository.
  3. Next to the project name, select the plus icon () to display a dropdown list, then select New file from the list.
  4. For Filename, provide one of the filenames that GitLab provides a template for:
    • .gitignore
    • .gitlab-ci.yml
    • LICENSE
    • Dockerfile
  5. Select Apply a template, then select the template you want to apply.
  6. Make your changes to the file.
  7. Provide a Commit message.
  8. Enter a Target branch to merge into. To create a new merge request with your changes, enter a branch name that is not your repository’s default branch,
  9. Select Commit changes to add the commit to your branch.

Edit a file

To edit a text file in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. Go to your file.
  3. In the upper right, select Edit > Edit single file.

Keyboard shortcuts

When you edit a file in the Web Editor, you can use the same keyboard shortcuts for the Web IDE. See the available shortcuts.

Preview Markdown

Introduced in GitLab 15.6.

To preview Markdown content in the Web Editor:

  1. Edit a file.
  2. Do one of the following:
    • Select the Preview tab.
    • From the context menu, select Preview Markdown.

In the Preview tab, you can see a live Markdown preview alongside your content.

To close the preview panel, do one of the following:

  • Select the Write tab.
  • From the context menu, select Hide Live Preview.

Introduced in GitLab 13.11.

To link to single or multiple lines in the Web Editor, add hash information to the filename segment of the URL. For example:

  • MY_FILE.js#L3 highlights line 3 in MY_FILE.js.
  • MY_FILE.js#L3-10 highlights lines 3 to 10 in MY_FILE.js.

To link to a single line, you can also:

  1. Edit a file.
  2. Select a line number.

Upload a file

To upload a binary file in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. From the project dashboard or repository, next to the branch name, select the plus icon ().
  3. From the dropdown list, select Upload file.
  4. Complete the fields. To create a merge request with the uploaded file, ensure the Start a new merge request with these changes toggle is turned on.
  5. Select Upload file.

Create a directory

To create a directory in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. From the project dashboard or repository, next to the branch name, select the plus icon ().
  3. From the dropdown list, select New directory.
  4. Complete the fields. To create a merge request with the new directory, ensure the Start a new merge request with these changes toggle is turned on.
  5. Select Create directory.

Create a branch

To create a branch in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. From the project dashboard or repository, next to the branch name, select the plus icon ().
  3. From the dropdown list, select New branch.
  4. Complete the fields.
  5. Select Create branch.

Create a tag

You can create tags to mark milestones such as production releases and release candidates. To create a tag in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. From the project dashboard or repository, next to the branch name, select the plus icon ().
  3. From the dropdown list, select New tag.
  4. Complete the fields.
  5. Select Create tag.