This gist will walk you through getting a GitHub repo cloned in an EC2 instance for MacOS or Linux. The below steps assumes you have an EC2 instance launched. If you do not, follow the AWS docs here.
Follow the steps outlined under Generating a new SSH key. Once complete, return here.
Copy the public key from the file you just saved your newly generated public key to the clipboard by pasting the below in terminal. The default name would be id_ed25519.pub which we assume throughout the rest of the guide. If you saved the public key to a different file name during generation of the new SSH key, substitute that file name in for id_ed25519.pub.