doc/user/project/repository/web_editor.md
{{< details >}}
{{< /details >}}
The Web Editor is a browser-based tool for making changes to your GitLab repositories without local setup. You can:
GitLab uses your primary email address for Web Editor commits.
For changes to multiple files, use the Web IDE.
[!note] To manage files in a protected branch, you must have the appropriate permissions.
You can create, edit, upload, and delete files with the Web Editor, directly from the GitLab UI.
To create a text file in the Web Editor:
In the top bar, select Search or go to and find your project.
Go to the directory where you want to create the new file.
Next to the directory name, select the plus icon ({{< icon name="plus" >}}) > New file.
Next to the branch name, enter a filename and extension. For example, my_file.md.
Add content to your file.
Select Commit changes.
In the Commit message field, enter a reason for the commit.
Choose one of the following options:
To create a file in the prefilled target branch, select Commit changes.
To create a file in a new branch and commit changes:
To create a file in a new branch, commit changes, and create a merge request:
To create a text file from a template in the Web Editor:
.gitignore.gitlab-ci.ymlLICENSEDockerfileTo edit a text file in the Web Editor:
In the top bar, select Search or go to and find your project.
Go to the file you want to edit.
Select Edit > Edit single file.
Make your changes.
Select Commit changes.
In the Commit message field, enter a reason for the commit.
Choose one of the following options:
To edit a file from the prefilled target branch, select Commit changes.
To edit a file from a new branch and commit changes:
To edit a file from a new branch, commit changes, and create a merge request:
[!note] If someone edits and commits changes to the same file while you are editing, you can't commit your changes. The following error message is displayed:
Someone edited the file the same time you did. Please check out the file and make sure your change will not unintentionally remove theirs.
To preview a Markdown file in the Web Editor:
You can see a live Markdown preview alongside your content.
To close the preview panel, select the Write tab.
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.
Prerequisites:
If you're working on a merge request from a forked project, you can edit a file and commit changes. To do this:
Your changes can be committed to <branch-name> because a merge request is open.To upload a file in the Web Editor:
In the top bar, select Search or go to and find your project.
Go to the directory where you want to upload the file.
Next to the directory name, select the plus icon ({{< icon name="plus" >}}) > Upload file.
Drop or upload the file you want to add.
In the Commit message field, enter a reason for the commit.
Choose one of the following options:
To upload a file from the prefilled target branch, select Commit changes.
To upload a file from a new branch and commit changes:
To upload a file from a new branch, commit changes, and create a merge request:
To delete a file in the Web Editor:
In the top bar, select Search or go to and find your project.
Go to the file you want to delete.
Select Delete.
In Commit message, enter a reason for the commit.
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:
To delete a file from a new branch, commit changes, and create a merge request:
[!note] If someone edits and commits changes to the same file while you are editing, you can't commit your changes. The following error message is displayed:
Someone edited the file the same time you did. Please check out the file and make sure your change will not unintentionally remove theirs.
To replace a file in the Web Editor:
In the top bar, select Search or go to and find your project.
Go to the file you want to replace.
Select Replace.
Drop or upload the file you want to upload and replace the existing one.
In Commit message, enter a reason for the commit.
Choose between the following options:
To replace a file from the prefilled target branch, select Commit changes.
To replace a file from a new branch and commit changes:
To replace a file from a new branch, commit changes, and create a merge request:
To cancel changes, edit, upload, or delete a file, from the Web Editor:
Select Cancel.
Select one of the following:
{{< history >}}
blob_overflow_menu. Disabled by default.blob_overflow_menu removed.{{< /history >}}
The Actions ({{< icon name="ellipsis_v" >}}) menu consolidates file operations into the dropdown list. From this menu, you can:
To complete these actions:
To create a directory in the Web Editor:
In the top bar, select Search or go to and find your project.
Go to the directory where you want to create the new directory.
Next to the directory name, select the plus icon ({{< icon name="plus" >}}) > New directory.
In the Directory name field, enter your directory name.
In Commit message, enter a reason for the commit.
Choose between the following options:
To create a directory from the prefilled target branch, select Commit changes.
To create a directory from a new branch and commit changes:
To create a directory from a new branch, commit changes, and create a merge request:
To create a branch in the Web Editor:
You can create tags to mark milestones such as production releases and release candidates. To create a tag in the Web Editor:
The web editor is based on the Monaco Editor which has several accessibility features, including:
| Feature | Shortcut on Windows or Linux | Shortcut on macOS | Details |
|---|---|---|---|
| Keyboard navigation command list | <kbd>F1</kbd> | <kbd>F1</kbd> | A list of commands that make the editor easier to use without a mouse. |
| Tab trapping | <kbd>Control</kbd>+<kbd>m</kbd> | <kbd>Control</kbd>+<kbd>Shift</kbd>+<kbd>m</kbd> | Enable tab trapping to go to the next focusable element on the page instead of inserting a tab character. |