Data Studio supports the integration of a personal development environment with a Git repository to facilitate code version management and team collaboration. This topic describes how to perform operations on code, such as pulling, adding, modifying, uploading, and committing code, from a remote Git repository in a personal development environment.
Background information
Data Studio supports the integration of a personal development environment with a remote Git repository. This way, you can directly perform operations on code in Data Studio, without the need to use other Git clients or command-line tools. For example, you can pull, add, modify, upload, and commit code, and switch the code branch. This facilitates code version management and team collaboration. For more information about how to use Git to manage source code in your personal development environment, see Using Git source control in VS Code.
Prerequisites
A resource group is created and associated with a workspace. For more information, see Create and use a serverless resource group.
A workspace is created, and computing resources are associated with the workspace. For more information.
A personal development environment is created. For more information, see Personal development environment.
Billing
You are charged computing fees based on the configured compute unit (CU) quota and running duration in a personal development environment. For more information about billing, see Billing of serverless resource groups.
You are charged computing fees if your personal development environment is in the running state. If you no longer need to use a personal development environment, stop the personal development environment on the instance management page at the earliest opportunity.
Precautions
You can select and use only a personal development environment that is created by using the current Alibaba Cloud account.
When you manage source code, you must enter the username and password that are used to access a remote Git repository for logon verification as prompted. Otherwise, the
Failed to authenticate to git remote
error message appears.
Step 1: Enter a personal development environment
Go to the Workspaces page in the DataWorks console. In the top navigation bar, select a desired region. Find the desired workspace and choose in the Actions column.
Enter a personal development environment.
In the top navigation bar, click the icon next to Select Personal development environment and then click the name of the personal development environment that you want to enter.
ImportantBefore you enter a personal development environment, make sure that the personal development environment is in the running state. Otherwise, an error message appears, indicating that the current environment is unavailable.
Step 2: Initialize and use a Git repository
After you enter a personal development environment, you can perform the following operations to initialize and use a Git repository:
Click the icon in the lower-left corner and select Command Palette. In the dialog box that appears, enter
Terminal
in the search box, and select View: Toggle Terminal to go to the TERMINAL tab.On the TERMINAL tab, initialize the Git repository and specify a username and an email address that are used to commit code. For more information, see Getting Started - First-Time Git Setup. Sample commands to specify a username and an email address:
git config --global user.name "John Doe" git config --global user.email johndoe@example.com
NoteYou must replace the username and email address in the commands with the actual information.
Clone your Git repository. To clone a Git repository, run the following command on the TERMINAL tab, enter the desired
username
andpassword
as prompted, and then press Enter:git clone https://xxx.git
NoteYou must replace
https://xxx.git
with the address of your Git repository.After the Git repository is cloned, you can modify files in the repository in the Personal Directory section of the DATASTUDIO pane () on the left. You can commit code by running commands on the TERMINAL tab or by using graphical user interfaces (GUIs) in the source code management menu. For more information about specific commands, see Using Git source control in VS Code.