Web Editor

You can use the Web Editor to make changes directly from the GitLab UI instead of cloning a project and using the command line.

From the project dashboard or repository, 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 top bar, select Main menu > Projects 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.
    • From the Select a template type dropdown list, you can apply a template to the new file.
    • To create a merge request with the new file, ensure the Start a new merge request with these changes checkbox is selected.
  5. Select Commit changes.

Edit a file

To edit a file in the Web Editor:

  1. On the top bar, select Main menu > Projects and find your project.
  2. Go to your file.
  3. Next to the display buttons, select Edit.

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 top bar, select Main menu > Projects 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 top bar, select Main menu > Projects 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 top bar, select Main menu > Projects 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 top bar, select Main menu > Projects 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.