All Products
Search
Document Center

:Connect a personal development environment to a Git repository

Last Updated:Dec 17, 2024

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

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.

Important

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

  1. Go to the Workspaces page in the DataWorks console. In the top navigation bar, select a desired region. Find the desired workspace and choose Shortcuts > Data Studio (New Version) in the Actions column.

  2. Enter a personal development environment.

    In the top navigation bar, click the image icon next to Select Personal development environment and then click the name of the personal development environment that you want to enter.

    image

    Important

    Before 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:

  1. Click the image 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.

    image

  2. 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
    Note

    You must replace the username and email address in the commands with the actual information.

  3. Clone your Git repository. To clone a Git repository, run the following command on the TERMINAL tab, enter the desired username and password as prompted, and then press Enter:

    git clone https://xxx.git
    Note

    You must replace https://xxx.git with the address of your Git repository.

  4. After the Git repository is cloned, you can modify files in the repository in the Personal Directory section of the DATASTUDIO pane (image) 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.

    image