A Step-by-Step Guide to Creating and Testing Lambda Functions.

Working with GIT

If you are connecting to your github account for the first time, you need to create public / private key on your system and upload the public key it on github.

Run the following command to generate a new key:

ssh-keygen -t ed25519 -C "sanaqvi573@gmail.com"
1

Add the SSH Key to the SSH Agent

Check if SSH agent is running, if not start the SSH agent:

eval "$(ssh-agent)"
eval "$(ssh-agent -s)"
2

Add your key to the agent:

ssh-add ~/.ssh/id_ed25519
3

Add the SSH Key to Your GitHub Account

cat ~/.ssh/id_ed25519.pub
4 1

Log in to your GitHub account and navigate to: Settings → SSH and GPG keys → New SSH key.

Paste the key, give it a title (e.g., “My Laptop”), and click Add SSH Key.

5
6
ssh -T git@github.com
7

If ssh -T git@github.com returns “Host key verification failed,” it means your system is unable to verify GitHub’s server identity. This typically happens due to an issue with the ~/.ssh/known_hosts file or GitHub’s host key being absent or outdated. Here’s how to fix it:

Manually add GitHub’s official host key to your known_hosts file.

ssh-keyscan github.com >> ~/.ssh/known_hosts

This will fetch and append GitHub’s host key to your known_hosts file. To verify that the key has been added, run:

cat ~/.ssh/known_hosts | grep github.com

Log into your github account and create new repository

1 1

Now create repository on your local system

mkdir syedtest && cd syedtest

Initialize git with the following command:

git init
2 1

Now let’s create file in local git repo so that we can verify after pushing

touch file1
3 2

Prepare for staging

git add .
git commit -m "File added"

If this is the first time that you are committing, you will be asked to set user name and email address.
4 1

Now add remote repository, copy link from repository created on github

4 1 1
git remote add origin git@github.com:techngi/syedtest.git
git branch -M main
git push -u origin main
5 1
12 1

The file will be copied to your github repository

8

Now edit the file on github and download the updated file on your local git

9
10

Now create a new branch i.e. dev on your local git and push it to github

git checkout -b dev
11

Now make some changes and push to github

13
12

This update will now show up under dev branch on github and will prompt checker to create pull request

14

Checker will be able to merge this pull request i.e. update to main branch

15
Tags: No tags

Add a Comment

Your email address will not be published. Required fields are marked *