Accessing a Git Repository Using a Key Pair
- Copy the keypair.pem into your .ssh folder.
cp /path/to/file/keypair.pem ~/.ssh/keypair.pem
- Create/open your .ssh config file.
nano ~/.ssh/config
- In your config file
Host git Hostname EC2PublicDNS User ubuntu IdentityFile /home/username/.ssh/keypair.pem
- To clone the repository use the following
git clone git:path/to/projects/PROJECT_NAME.git
- To update existing projects on your machine to use the new address follow the instructions below
- Open your project's git config file
nano ~/path/to/project/.git/config
- Change the url line to be
git:path/to/projects/PROJECT_NAME.git
Comments
Join the discussionNo comments yet. Be the first to comment.




