How to setup azure repos with VS code?

  • Work Process - Purpose
    • This page will show the setup steps about the VS code working environment for EGIS developers;
  • Work Process - Summary
    • Basic steps are:
      • download and install vs code;
      • link to Azure cloud;
      • add python setting;
      • steps for code update submit process and merge;
  • Contribution Of The Client Group To The Work Process
    • Bill Xu
    • Lawrence Chong
  • Steps Of The Work Process
    • Installation and setup:
      • download and install vs code;
        • https://code.visualstudio.com/
        • Azure Extensions

          You can use Azure directly from Visual Studio Code through extensions.

        • You must install the Azure Git Repos extension and following the instruction in this extension to setup the repos correctly:

The org in the steps is: https://dev.azure.com/TCOPP  

Create token by go to https://dev.azure.com/TCOPP/_usersSettings/about; click the Personal access tokens , create new token by use your name;

      • link to Azure cloud;
        • Configuring Visual Studio Code

          • Open Visual Studio Code. In this task, you will configure a Git credential helper to securely store the Git credentials used to communicate with Azure DevOps. If you have already configured a credential helper and Git identity, you can skip to the next task.

          • From the main menu, select Terminal | New Terminal to open a terminal window.

          • Execute the command below to configure a credential helper.

             git config --global credential.helper wincred
            
          • The commands below will configure your user name and email for Git commits. Replace the parameters with your preferred user name and email and execute them.

            git config --global user.name "Bill Xu"

            git config --global user.email bill.xu@034gc.onmicrosoft.com

        • Cloning an existing repository


            1. In a browser tab, navigate to your team project on Azure DevOps.

              1. The link is https://dev.azure.com/TCOPP/_git/EGIS?path=%2FTC%20Smart%20Maps%2FFME&version=GBmaster

            2. Getting a local copy of a Git repo is called “cloning”. Every mainstream development tool supports this and will be able to connect to Azure Repos to pull down the latest source to work with. Navigate to the Repos hub.

            3. Click Clone.

            4. You can directly Clone to VS Code or follow these:

              1. Click the Copy to clipboard button next to the repo clone URL. You can plug this URL into any Git-compatible tool to get a copy of the codebase.

              2. Open an instance of Visual Studio Code.

              3. Press Ctrl+Shift+P to show the Command Palette. The Command Palette provides an easy and convenient way to access a wide variety of tasks, including those provided by 3rd party extensions.

              4. Execute the Git: Clone command. It may help to type “Git” to bring it to the shortlist.

              5. Paste in the URL to your repo and press Enter.

              6. Select a local path to clone the repo to.

              7. When prompted, log in to your Azure DevOps account.

              8. Once the cloning has completed, click Open Repository. You can ignore any warnings raised about opening the projects. The solution may not be in a buildable state, but that’s okay since we’re going to focus on working with Git and building the project itself is not necessary.


      • https://www.develves.net/blogs/asd/articles/using-git-with-powershell-on-windows-10/
    • steps for code update submit process and merge;