Tutorial: Edit a file using the Web Editor

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

Project files may be edited by team members who have appropriate access.

Learn how to edit an individual file directly in the GitLab UI using the simple Web Editor.

Select the file you wish to edit

First, go to the project home page to get a list of files in the project.

A file listing on the project home page. It shows a project named “Company Handbook” with files named things like “break-room.md”.

Select any file to view its details.

The “break-room.md” file is shown in detail. Its contents show amenities such as cards, video games, and a pool table.

Edit the file

Select the Edit dropdown list, and then select Edit single file.

The Edit button expands to show the dropdown list options, “Open in Web IDE” and “Edit Single File”.

In the editor, make your edits to the file as needed.

The file reappears in an editable text field, allowing the viewer to change its contents.

Commit your changes and create a merge request

It is possible to commit (save) your changes directly to the file. However, this is not recommended for most teams, as it is good practice to first have your changes reviewed by a team member. In this step, you’ll create a branch and merge request with the new changes.

After you have finished editing:

  1. Select Commit changes.
  2. Fill in the commit message text box with a description of your changes.
  3. Under Branch, select Commit to a new branch.
  4. Under Commit to a new branch, enter a name for your new branch or leave the automatically generated one provided for you.
  5. Make sure Create a merge request for this change is selected.

The commit changes form with example values. The commit message is “Remove mention of the ping-pong table”, “commit to a new branch” is selected, and the branch is named “ping-pong-table-removal”.

Finally, select Commit changes to commit your changes to the new branch. The new merge request form appears. To create the request, do the following:

  1. Set the Title to an appropriate summary of the changes.
  2. Put more details about your changes in the Description field.
  3. Set the Assignee to yourself.
  4. If you know who should review your changes, set the Reviewer.
  5. Optional. Set the milestone of your merge request.
  6. Optional. Set labels for your merge request to better categorize it.
  7. Select Create merge request to create your merge request.

The form of the new merge request, showing the title set as “Remove mention of the ping-pong table” and the description as “This merge request removes the ping-pong table from the break room page since we no longer have one.”

Your edits are now in a merge request, and ready to be reviewed by another contributor.

Next steps

Next you can: