diff --git a/app/assets/javascripts/ide/init_gitlab_web_ide.js b/app/assets/javascripts/ide/init_gitlab_web_ide.js index 46c1b66a15c80586086ffc67861365f0f72ef886..8bc706adc9010989ee6df92c04754e7ff7468863 100644 --- a/app/assets/javascripts/ide/init_gitlab_web_ide.js +++ b/app/assets/javascripts/ide/init_gitlab_web_ide.js @@ -81,6 +81,7 @@ export const initGitlabWebIDE = async (el) => { }, featureFlags: { languageServerWebIDE, + additionalSourceControlOperations: true, }, editorFont, extensionsGallerySettings: extensionMarketplaceSettings, diff --git a/doc/user/project/web_ide/_index.md b/doc/user/project/web_ide/_index.md index e43f305a49e782e3236bfd9c3c482e9b87e6e4ba..de640a1ea9db19005855128a785254eef96ff2a8 100644 --- a/doc/user/project/web_ide/_index.md +++ b/doc/user/project/web_ide/_index.md @@ -150,9 +150,33 @@ To commit changes in the Web IDE: 1. On the left side of the Web IDE, select **Source Control** ({{< icon name="branch" >}}), or press Control+Shift+G. 1. Enter your commit message. -1. Commit to the current branch or [create a new branch](#create-a-branch). +1. Select one of the following commit options: + - **Commit to current branch** - Commits changes to the current branch + - **[Create a new branch](#create-a-branch)** - Creates a new branch and commits changes + - **[Commit and force push](#commit-and-force-push)** - Force pushes changes to the remote branch + - **[Amend commit and force push](#amend-commit-and-force-push)** - Modifies the last commit and force pushes -### Create a merge request +### Commit and force push + +To commit and force push your changes: + +1. Select the action button menu or select the ellipsis ({{< icon name="ellipsis_h" >}}). +1. Select **Commit and Force push**. + +{{< alert type="warning" >}} +This action overwrites the remote history of the current branch. Use with caution. +{{< /alert >}} + +### Amend commit and force push + +To amend the last commit and force push: + +1. Select the action button menu or select the ellipsis ({{< icon name="ellipsis_h" >}}). +1. Select **Amend commit and Force push**. + +This updates the last commit and force pushes it to the remote repository. Use this to fix recent commits without creating new ones. + +## Create a merge request To create a [merge request](../merge_requests/_index.md) in the Web IDE: diff --git a/spec/frontend/ide/init_gitlab_web_ide_spec.js b/spec/frontend/ide/init_gitlab_web_ide_spec.js index de3c6ab6792d949f264be47594f3bb4a47e862a9..57291f6fbaf2acc02fd0b9fe8330793082276752 100644 --- a/spec/frontend/ide/init_gitlab_web_ide_spec.js +++ b/spec/frontend/ide/init_gitlab_web_ide_spec.js @@ -158,6 +158,7 @@ describe('ide/init_gitlab_web_ide', () => { }, featureFlags: { languageServerWebIDE: gon.features.webIdeLanguageServer, + additionalSourceControlOperations: true, }, editorFont: { fallbackFontFamily: 'monospace',