Urgent.News

What's breaking now, across thousands of outlets.

Tech

How To Upload Your First Project From a Local Folder to GitHub Using Git and SSH.

Introduction If you want to upload a project from your computer to your GitHub account, it can be done by simply using Git and SSH. This is one of the most important technical skills you can learn as a beginner because you will use this every time you want to create and or update an existing project. For a person using Windows OS, follow these simple steps as illustrated below. 1. Download Git…

Uploading your first project from a local folder to GitHub using Git and SSH involves several straightforward steps. To begin, download Git from the Microsoft Store and install it on your computer. Next, create a GitHub account using your email and a password. Afterward, set up your identity by configuring your name and email address in Gitbash using git config --global user.name "Your Name" and git config --global user.email "your-email@example.com".

To check for an existing SSH key, use the command ls -al ~/.ssh. If no SSH key is found, generate a new one by running ssh-keygen -t ed25519 -C "your-email@example.com". This will create both a private key (id_ed25519) and a public key (id_ed25519.pub). When prompted, press Enter to accept the default location for the key files and enter a passphrase for enhanced security.

On Windows, ensure the SSH agent is running by opening PowerShell as an Administrator and executing Get-Service -Name ssh-agent | Set-Service -StartupType Manual, followed by Start-Service ssh-agent. Return to Gitbash and add the private SSH key using ssh-add ~/.ssh/id_ed25519. Copy the public SSH key from id_ed25519.pub by running cat ~/.ssh/id_ed25519.pub and paste it into GitHub under Settings → SSH and GPG keys → New SSH Key. Provide a title for the key and click Add key.

Next, navigate to your project folder on your computer and open Gitbash. Initialize a new Git repository using git init -b main, which creates a new branch named "main". Verify that the local project is initialized by running git status, then add all files in the directory with git add . and commit the changes with git commit -m "Initial commit".

To upload the project to GitHub, first create a new repository on GitHub with a descriptive name, either public or private. After creating the repository, copy the SSH URL provided. Return to Gitbash and add the remote repository using git remote add origin "SSH URL". Verify the remote location with git remote -v, and push the changes to GitHub using git push -u origin main. Finally, check GitHub to confirm that the project has been successfully uploaded.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

My First GitHub Project.

Introduction People, especially beginners, face challenges when making changes to their projects and pushing those changes to Github.

More from Saturday 22 August →