Please check gitlab-tutorial

Skip to content

Web Editor

DETAILS: Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

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.

Your primary email address is used by default for any change you commit with 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. Go to the directory where you want to create the new file.
  3. Next to the directory name, select the plus icon ({plus}) > New file.
  4. Complete the fields. To create a merge request with your changes, enter a branch name that's not your repository's default branch.
  5. Select Commit changes.

From a template

To create a text file from a template in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. Go to the directory where you want to create the new file.
  3. Next to the directory name, select the plus icon ({plus}) > New file.
  4. In Filename, enter a name that GitLab provides a template for:
    • .gitignore
    • .gitlab-ci.yml
    • LICENSE
    • Dockerfile
  5. From the Apply a template dropdown list, select a template.
  6. Complete the fields. To create a merge request with your changes, enter a branch name that's not your repository's default branch.
  7. Select Commit changes.

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 the file you want to edit.
  3. Select Edit > Edit single file.
  4. Complete the fields. To create a merge request with your changes, enter a branch name that's not your repository's default branch.
  5. Select Commit changes.

Preview Markdown

To preview a Markdown file in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. Go to the file you want to preview.
  3. Select Edit > Edit single file.
  4. Select the Preview tab.

You can see a live Markdown preview alongside your content.

To close the preview panel, select the Write tab.

Link to specific lines

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.

When you edit a file, you can also link to a single line by selecting a line number.

Upload a file

To upload a file in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. Go to the directory where you want to upload the file.
  3. Next to the directory name, select the plus icon ({plus}) > Upload file.
  4. Complete the fields. To create a merge request with your changes, enter a branch name that's not your repository's default branch.
  5. Select Upload file.

Delete a file

NOTE: You cannot delete a file from a protected branch without the necessary permissions.

To delete a file in the Web Editor:

  1. On the left sidebar, select Search or go to and find your project.
  2. Go to the file you want to delete.
  3. Select Delete.
  4. In Commit message, enter a reason for the commit.
  5. Choose between the following options:
    • To delete a file from the prefilled target branch, select Commit changes.
    • To delete a file from a new branch and commit changes:
      1. Select Commit to a new branch.
      2. Enter a branch name.
      3. Ensure the Create a merge request for this change checkbox is cleared.
      4. Select Commit changes.
    • To delete a file from a new branch, commit changes, and create a merge request:
      1. In Target branch, enter a branch name.
      2. Select Commit to a new branch.
      3. Enter a branch name.
      4. Ensure the Create a merge request for this change checkbox is selected.
      5. Select Commit changes.

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. Go to the directory where you want to create the new directory.
  3. Next to the directory name, select the plus icon ({plus}) > New directory.
  4. Complete the fields. To create a merge request with your changes, enter a branch name that's not your repository's default branch.
  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. Next to the repository name, select the plus icon ({plus}) > New branch.
  3. Complete the fields.
  4. 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. Next to the repository name, select the plus icon ({plus}) > New tag.
  3. Complete the fields.
  4. Select Create tag.