Link to local Git client

Initial setup

Setting up Git desktop client, AWS CLI, and TIA portal VCI

I. Installing Git CLI client

When installing Git CLI on Windows, please do not install the Git Credential Manager. (AWS CLI comes with its credential manager).

Select the option "Do no use credential helper" as shown below.

Note that in case you have Git already installed you nevertheless need to reinstall it with the above settings to be able to use the correct credential helper.

Basic configuration of Git

Open a command line and run the following commands

git config --global user.name "Your Name"

git config --global user.email "your_email@your_domain.com"

II. Installation of AWS CLI

Installation requirements

  • Microsoft-supported versions of 64-bit Windows.

  • You need Admin rights to install software on your computer.

Install or update the AWS CLI

To update your current installation of AWS CLI on Windows, download a new installer each time you update to overwrite previous versions. AWS CLI is updated regularly. To see when the latest version was released, see the AWS CLI changelog on GitHub.

Download and run the AWS CLI MSI installer for Windows (64-bit):

https://awscli.amazonaws.com/AWSCLIV2.msi

Alternatively, you can run the msiexec command to run the MSI installer.

C:\> msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

For various parameters that can be used with msiexec, see msiexec on the Microsoft Docs website.

Confirm installation

To confirm the installation, open the Start menu, search for cmd to open a command prompt window, and type the command aws --version in the command prompt.

The result should like shown below

aws-cli/2.8.7 Python/3.9.11 Windows/10 exe/AMD64 prompt/off

If Windows cannot find the program, you might need to close and reopen the command prompt window to refresh the path or Add the AWS CLI to your path.

Configure installation

After successful installation, run the following command in a command prompt window.

aws configure

Simply press enter to all questions you are asked.

Configuring Git client to use AWS credential helper

Run the following command to open the Git config file in a text editor.

git config --global --edit

Alternatively, you can navigate to your Windows Users folder (e.g., C:/Users/<Username>), locate the file ".gitconfig" and open it in an editor. Note: You may need to activate "show hidden files" in your Windows Explorer setting to be able to see the file.

The chosen username and email address will be displayed in the SDA Console as the user that committed a certain code change.

On the text editor, add a new line, and copy and paste the following content.

[credential "https://git-codecommit.eu-west-1.amazonaws.com"] 
    helper = !aws codecommit credential-helper $@ 
    UseHttpPath = true

The complete fill should look like shown below.

Notes

  • If you are using a Bash emulator instead of the Windows command line, you must use single quotes instead of double quotes.

  • The credential helper uses the [default] AWS profile.

If your installation of Git for Windows included the Git Credential Manager utility, we recommend to reinstall Git with settings as described above.

III. Set up SDA credentials

The SDA credentials last for a maximum of twelve hours. After the expiration, the credentials can't be used anymore, and you need to get new ones from the SDA console.

  1. Get your credentials in the SDA console:

    1. Access your account.

    2. Open a repository in DevOps.

    3. Expand the clone button and click on Get credentials (see below)

    4. A new dialog will open. Select Windows, and click on the credential to copy it to the clipboard.

5. With the credential in the clipboard, go to the /.aws folder located at the root folder of your user name on Windows and create a new file called credentials if you don't have one yet.

Open the file with a text editor, paste the credentials keys (option 2) you got from the SDA console. Make sure that the file starts with [default]. In the total file should look like shown in the screenshot below. Then save and close the file.

IV. Clone your repository

  1. Navigate to the corresponding repository in the SDA Console (Projects --> Locate respective project --> Linked repository)

  2. Select the clone dropdown button, and copy the HTTPS URL.

  3. Create a new folder in your local file system or go to the folder where the project repository should be cloned to.

  4. Open a shell window in your local machine and navigate to the respective folder. E.g., use the code below.

cd C:/Users/<Your username>/Git/<Your repository folder>

5. Run the git clone command with your copied url:

git clone <HTTPS URL>

6. The repository should now be successfully cloned into the chosen folder.

Troubleshooting

I receive a 403 response when trying to clone the repository

Try running the following command in your local terminal:

aws sts get-caller-identity

The return should like shown below.

If instead this command returns an error, try restarting the cmd by closing and opening it again.

Last updated