To pull your repository from GitHub onto your Ubuntu machine, follow these steps:
If Git is not installed on your Ubuntu system:
sudo apt update
sudo apt install git
Verify the installation:
git --version
Set up your username and email for Git (if not already configured):
git config --global user.name "YourName"
git config --global user.email "youremail@example.com"
To securely interact with GitHub using SSH:
Generate an SSH key:
ssh-keygen -t ed25519 -C "youremail@example.com"
Press Enter to use the default path, and optionally set a passphrase.
Add the SSH key to the SSH agent:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
Copy the SSH key to your clipboard:
cat ~/.ssh/id_ed25519.pub
Copy the output and add it to your GitHub account under Settings > SSH and GPG keys > New SSH key.
Test the SSH connection:
ssh -T git@github.com
You would see message like below,
Hi git-username ! You've successfully authenticated, but GitHub does not provide shell access.
Navigate to the directory where you want to clone your repository:
Choose a 'coding-directory' based on you preference.
cd ~/coding-directory
Clone the repository:
If using HTTPS:
git clone https://github.com/Vignana-Jyothi/codelabs.git
If using SSH:
git clone git@github.com:Vignana-Jyothi/codelabs.git
Navigate to the cloned repository:
cd codelabs
To pull the latest changes:
git pull origin main
Watch them in your favorite IDE