Web Editor
You can use the Web Editor directly in the GitLab UI without cloning repositories locally or using the command line.
Use the Web Editor to:
- Edit single files without a local development environment.
- Create or upload new files.
- Replace a file with another file.
- Create new directories.
- Create a branch or tag.
- Lock a file or a directory.
- Contribute to projects without setting up Git locally.
GitLab uses your primary email address for Web Editor commits.
For changes to multiple files, use the Web IDE.
Manage files
You can create, edit, upload, and delete files with the Web Editor, directly from the GitLab UI.
Create a file
To create a text file in the Web Editor:
- On the left sidebar, 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 () > 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:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is cleared.
- Select Commit changes.
-
To create a file in a new branch, commit changes, and create a merge request:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is selected.
- Select Commit changes.
From a template
To create a text file from a template in the Web Editor:
- On the left sidebar, 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 () > New file.
- In Filename, enter a name that GitLab provides a template for:
.gitignore
.gitlab-ci.yml
LICENSE
Dockerfile
- From the Apply a template dropdown list, select a template.
- Optional. Update the template as desired.
- Continue from the step 6 in the create a file process.
Edit a file
To edit a text file in the Web Editor:
- On the left sidebar, 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:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is cleared.
- Select Commit changes.
-
To edit a file from a new branch, commit changes, and create a merge request:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is selected.
- Select Commit changes.
- Fill out the fields and select Create merge request.
Someone edited the file the same time you did. Please check out the file and
make sure your change will not unintentionally remove theirs.
Markdown preview
- Introduced in GitLab 15.6.
To preview a Markdown file in the Web Editor:
- On the left sidebar, select Search or go to and find your project.
- Go to the file you want to preview.
- Select Edit > Edit single file.
- 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 inMY_FILE.js
. -
MY_FILE.js#L3-10
highlights lines 3 to 10 inMY_FILE.js
.
When you edit a file, you can also link to a single line by selecting a line number.
Edit files in a forked merge request
Prerequisites:
- You must work on a merge request from a fork.
- Allow commits from upstream members must be enabled.
If you’re working on a merge request from a forked project, you can edit a file and commit changes. To do this:
- Go to the merge request.
- Go to the file you want to edit.
- Select Edit > Edit single file.
- Select Commit changes.
- In Commit message, enter a reason for the commit.
The following information is provided:
Your changes can be committed to <branch-name> because a merge request is open.
- Select Commit changes.
Upload a file
To upload a file in the Web Editor:
- On the left sidebar, 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 () > Upload file.
- Drop or upload the file your 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:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is cleared.
- Select Commit changes.
-
To upload a file from a new branch, commit changes, and create a merge request:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is selected.
- Select Commit changes.
- Fill out the fields and select Create merge request.
Delete a file
To delete a file in the Web Editor:
- On the left sidebar, 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:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is cleared.
- Select Commit changes.
-
To delete a file from a new branch, commit changes, and create a merge request:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is selected.
- Select Commit changes.
Someone edited the file the same time you did. Please check out the file and
make sure your change will not unintentionally remove theirs.
Replace a file
To replace a file in the Web Editor:
- On the left sidebar, 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:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is cleared.
- Select Commit changes.
-
To replace a file from a new branch, commit changes, and create a merge request:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is selected.
- Select Commit changes.
Cancel file changes
To cancel changes, edit, upload, or delete a file, from the Web Editor:
- Select Cancel.
-
Select one of the following:
- Confirm you want to cancel changes: Select OK.
- Don’t cancel changes: Select Cancel.
Create a directory
To create a directory in the Web Editor:
- On the left sidebar, 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 () > 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:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is cleared.
- Select Commit changes.
-
To create a directory from a new branch, commit changes, and create a merge request:
- Select Commit to a new branch.
- Enter a branch name.
- Ensure the Create a merge request for this change checkbox is selected.
- Select Commit changes.
Create a branch
To create a branch in the Web Editor:
- On the left sidebar, select Search or go to and find your project.
- Next to the repository name, select the plus icon () > New branch.
- Complete the fields.
- 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:
- On the left sidebar, select Search or go to and find your project.
- Next to the repository name, select the plus icon () > New tag.
- Complete the fields.
- Select Create tag.