Clone a remote Git repository

Completed

Another way to link a remote repository with a local repository is by cloning a remote Git repository. With the clone command, you get a copy of the remote repository and you automatically are linked to this repository. Once linked, you can easily get and send updates.

git clone <url> <dirname>

The dirname parameter is optional. By default, the clone command will create a local directory with the name of the Git repository. If you would like to change the name, you can provide a different directory name.

You can find the url in the first section of the repository page in your Azure DevOps repo.

Screenshot of the Clone URL in Azure DevOps.

In this example, we are cloning an empty repository. This means that you still need to use the AL: Go! command in Visual Studio Code to create an AL extension within this repository.

In Visual Studio Code you can clone a repository using View, Command Palette (Ctrl+Shift+P) and search for the command Git: Clone.

Screenshot of the search for Git: Clone in Visual Studio Code.

First you need to provide the Azure DevOps clone URL, and then you need to select a local repository location and sometimes (depending on your Windows Configuration) it will also ask you to sign in with your Microsoft or Organizational Account.

Finally, you get the option to open the cloned repository within Visual Studio Code.

Screenshot of the Open the cloned repository message.

In most situations, you will clone a repository that already contains an AL extension project. Then you can use the Clone button within Azure DevOps to get the clone URL. Therefore, you open a project in Azure DevOps, select a repository and in the Files section you can see the Clone button.

Screenshot of the Clone button in the Files section.