Using source control in the ServiceNow IDE
Use Git commands and other source control features in the ServiceNow IDE to manage changes to an application across a development team.
Role required: admin
Git commands
After initializing a local Git repository in the ServiceNow IDE, you can perform several Git commands from the Source Control view (
Source Control\) or command palette, including but not limited to the following commands.
| Command | Description |
|---|---|
| Checkout to ( Image omitted: servicenow-ide-more-actions-icon.png Check out another branch from the repository. Select the branch from the list or create a branch and push it to the remote repository.Only one branch per repository can be checked out at a time on an instance\(or developer sandbox\).More actions > <strong>Checkout to...</strong>) Command palette: <strong>Git: Checkout to...</strong></td><td> | |
| Clone ( Image omitted: servicenow-ide-more-actions-icon.png Clone a remote repository to add an application to your workspace.For more information, see Clone a Git repository with the ServiceNow IDE.More actions > <strong>Clone</strong>) Command palette: <strong>Git: Clone</strong></td><td> | |
| Commit ( Image omitted: servicenow-ide-commit-icon.png Commit your staged changes to the local repository. Enter a commit message to describe your changes.Commit) Command palette: <strong>Git: Commit</strong></td><td> | |
| Create branch ( Image omitted: servicenow-ide-more-actions-icon.png Add a branch to a repository and check it out.More actions > <strong>Branch</strong> > <strong>Create branch...</strong>)Command palette: <strong>Git: Create branch...</strong></td><td> | |
| Discard ( Image omitted: servicenow-ide-discard-icon.png Discard changes to undo modifications to an application.Discard Changes)Command palette: <strong>Git: Discard Changes</strong></td><td> | |
| Fetch ( Image omitted: servicenow-ide-more-actions-icon.png Fetch to sync commits and branches from the remote repository into the local repository.More actions > <strong>Fetch</strong>)Command palette: <strong>Git: Fetch</strong></td><td> | |
| Pull ( Image omitted: servicenow-ide-more-actions-icon.png Pull to merge the latest changes from the remote repository into the local repository.More actions > <strong>Pull</strong>)Command palette: <strong>Git: Pull</strong></td><td> | |
| Push ( Image omitted: servicenow-ide-more-actions-icon.png Push your committed changes to the remote repository.More actions > <strong>Push</strong>)Command palette: <strong>Git: Push</strong></td><td> | |
| Stage ( Image omitted: servicenow-ide-stage-icon.png Stage the changes in your working directory that you want to commit. When you stage changes, files move from the Changes list to the Staged Changes list.Stage Changes) Command palette: <strong>Git: Stage Changes</strong></td><td> | |
| Stash ( Image omitted: servicenow-ide-more-actions-icon.png More actions > <strong>Stash</strong>)Command palette: <strong>Git: Stash</strong>, <strong>Git: Pop</strong>, <strong>Git: Drop</strong>, <strong>Git: List</strong>, <strong>Git: Apply</strong>, <strong>Git: Clear</strong></td><td>Stash all uncommitted changes to save them in your working directory locally and come back to them later.The pop, drop, list, apply, and clear subcommands are supported when stashing. Select <strong>Stash</strong> > <strong>Apply</strong> to reapply your changes in your working directory.</td></tr></tbody> Merge conflictsIf there’s a conflict between local and remote changes in a file, the file is listed under Merge conflicts in the Source Control view ( Image omitted: servicenow-ide-source-control-icon.png Source Control\). You can review conflicts in the editor and resolve them by accepting the current or incoming change, both, or manually editing the file. Commit historyThe commit history for a branch is listed in the Commits section of the Source Control view ( Image omitted: servicenow-ide-source-control-icon.png Source Control\) and includes details about the commits. To see the commit history for a file, navigate to the File Explorer view \(\[Omitted image "servicenow-ide-file-explorer-icon.png"\] Alt text: File Explorer\), select the file, and expand the Timeline section. When you select a commit, a Diff editor comparing the changes opens. Repository changesTo update the remote repository an application is connected to, you can use the Parent Topic:Integrating source control with the ServiceNow IDE Related topics Connect to a Git provider using basic authentication with the ServiceNow IDE Connect to a Git provider using OAuth 2.0 with the ServiceNow IDE Configure a MID Server to use source control with the ServiceNow IDE Initialize a Git repository with the ServiceNow IDE |