My First GitHub Project: From a Local Folder to GitHub Using Git and SSH.
Introduction Git is local software that i installed on my machine to help me manage codes while github is an online platform that host git repositories. This is a step by step guide of how i used git to publish my first project to github while a SSH key for a secure connection with github. Tools Used This task was done in the following environments Windows Operating system Git git --version git…
Git is a local software installed on a computer to manage coding projects, while GitHub is an online platform that hosts Git repositories. This guide outlines how to publish a first project to GitHub using Git and an SSH key for a secure connection. The tools used include Windows Operating System, Git version 2.55.0.windows.4, a GitHub account, and SSH key generation.
To link Git and GitHub, the following steps were taken:
1. Configure Git by setting the username and email associated with the GitHub account using the commands `git config --global user.name alfieotuko` and `git config --global user.email alfiemauwa7@gmail.com`.
2. Generate an SSH key by running `ssh-keygen -t ed25519 -C alfiemauwa7@gmail.com`. This creates a private and a public key. The public key should be copied and pasted into the GitHub account settings under SSH AND GPG keys.
3. Verify the SSH key by typing `ssh -T git@github.com`. A successful message will be displayed.
4. Create a local folder to hold the project data by using the commands `cd Desktop`, `mkdir kenya-hospital-records-analysis`, and `cd kenya-hospital-record-analysis`.
5. Create a README.md file inside the project folder and a data folder using the commands `touch README.md` and `mkdir data`.
6. Initialize a Git repository by running `git init` and check the current branch with `git status`. It should show the branch as 'main'.
7. Stage and commit the changes by using `git add .` followed by `git commit -m "first commit for kenya-hospital-records-analysis"`.
8. Link the local Git repository to the GitHub repository by adding the remote origin with `git remote add origin git@github.com:alfieotuko/kenya-hospital-records-analysis`.
9. Push the changes to GitHub using `git push -u origin main`.
After completing these steps, the local folder is saved and hosted on a cloud-based GitHub repository. The SSH key provides a secure connection for accessing the hosted project. The GitHub link to the repository is alfieotukoGithub.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.