stage | group | info |
---|---|---|
Create |
IDE |
To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments |
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.
In the Web Editor, you can:
Your primary email address is used by default for any change you commit through the Web Editor.
To create a text file in the Web Editor:
- On the left sidebar, at the top, select Search GitLab ({search}) to find your project.
- From the project dashboard or repository, next to the branch name, select the plus icon ({plus}).
- From the dropdown list, select New file.
- Complete the fields.
- To create a merge request with the new file, ensure the Start a new merge request with these changes checkbox is selected, if you had chosen a Target branch other than the default branch (such as
main
). - Select Commit changes.
- On the left sidebar, at the top, select Search GitLab ({search}) to find your project.
- Select Code > Repository.
- Next to the project name, select the plus icon ({plus}) to display a dropdown list, then select New file from the list.
- For Filename, provide one of the filenames that GitLab provides a template for:
.gitignore
.gitlab-ci.yml
LICENSE
Dockerfile
- Select Apply a template, then select the template you want to apply.
- Make your changes to the file.
- Provide a Commit message.
- Enter a Target branch to merge into. To create a new merge request with your changes, enter a branch name that is not your repository's default branch,
- Select Commit changes to add the commit to your branch.
To edit a text file in the Web Editor:
- On the left sidebar, at the top, select Search GitLab ({search}) to find your project.
- Go to your file.
- In the upper right, select Edit > Edit single file.
When you edit a file in the Web Editor, you can use the same keyboard shortcuts for the Web IDE. See the available shortcuts.
Introduced in GitLab 15.6.
To preview Markdown content in the Web Editor:
- Edit a file.
- 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 inMY_FILE.js
.MY_FILE.js#L3-10
highlights lines 3 to 10 inMY_FILE.js
.
To link to a single line, you can also:
- Edit a file.
- Select a line number.
To upload a binary file in the Web Editor:
- On the left sidebar, at the top, select Search GitLab ({search}) to find your project.
- From the project dashboard or repository, next to the branch name, select the plus icon ({plus}).
- From the dropdown list, select Upload file.
- 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.
- Select Upload file.
To create a directory in the Web Editor:
- On the left sidebar, at the top, select Search GitLab ({search}) to find your project.
- From the project dashboard or repository, next to the branch name, select the plus icon ({plus}).
- From the dropdown list, select New directory.
- 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.
- Select Create directory.
To create a branch in the Web Editor:
- On the left sidebar, at the top, select Search GitLab ({search}) to find your project.
- From the project dashboard or repository, next to the branch name, select the plus icon ({plus}).
- From the dropdown list, select New branch.
- Complete the fields.
- Select Create branch.
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, at the top, select Search GitLab ({search}) to find your project.
- From the project dashboard or repository, next to the branch name, select the plus icon ({plus}).
- From the dropdown list, select New tag.
- Complete the fields.
- Select Create tag.