Check out example codes for "multiple git accounts for aws". It will help you in understanding the concepts better.

Code Example 1

# This file is:  ~/.ssh/config

# You may have other (non-CodeCommit) SSH credentials stored in this
# config file – in addition to the CodeCommit settings shown below.

# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file!

# Credentials for Account1
Host awscc-account1                                 # 'awscc-account1' is a name you pick
  Hostname   # This points to CodeCommit in the 'US East' region
  User A1EXAMPLE01234567891                         # UserID as provided by IAM Security Credentials (SSH)
  IdentityFile ~/.ssh/account1-awsCC-rsa            # Path to corresponding key file

# Credentials for Account2
Host awscc-account2
  User A2EXAMPLE01234567892
  IdentityFile ~/.ssh/account2-awsCC-rsa

# Credentials for Account3
Host awscc-account3
  User A3EXAMPLE01234567893
  IdentityFile ~/.ssh/account3-awsCC-rsa

Learn ReactJs, React Native from