Urgent.News

What's breaking now, across thousands of outlets.

Tech

My First GitHub Project: From a Local Folder to GitHub Using Git and SSH.

Introduction The following is a step-by-step process of how i was able create my first GitHub project from a local folder and upload it to Github using Git and SSH. Creating a local folder using git. Using Gitbash, I wanted to see the list of files and directories on my pc. I used the command function ls which enabled me to see them. Since I wanted to create a folder in Desktop under OneDrive, I…

Beginning My First GitHub Project: From a Local Folder to GitHub Using Git and SSH

The following article provides a detailed account of how the author successfully created their first GitHub project from a local folder and uploaded it to GitHub using Git and SSH. To start, the author used Gitbash to view the list of files and directories on their PC, employing the command function ls. Next, they navigated to the Desktop within the OneDrive directory using cd OneDrive and cd Desktop, respectively.

This demonstrates how the 'change of directory' command function cd allows users to access specific directories.

Creating a New Folder

The author proceeded to create a folder called 'Kenya-Hospital-Health-Records-Project' by using the mkdir command. This command allows users to create new directories, and the author uses hyphens, underscores, and quotes in the folder name since including spaces would result in separate folders instead of a single folder.

Accessing the Newly Created Folder

To access the newly created folder, the author utilizes cd Kenya-Hospital-Health-Records-Project. Afterwards, they create another folder within it called 'data' using mkdir data. The author then explains that a README file can be created to provide context about the project on GitHub. They utilize the touch command to generate a file named README.md, where the .md indicates that the file is written in Markdown format.

Writing the README File

The author writes the README file using the command echo, followed by a series of '#' and '##' symbols to denote the title and subheading of the file, respectively. The 'cat' command is then used to display the contents of the README.md file, and nano is used to make further edits to the file.

Initializing Git and Committing Changes

To treat the folder as a Git repository, the author runs git init, which creates a hidden folder. They verify the untracked files using git status, followed by git add . to prepare changes for the next commit. After confirming the readiness for commitment, they use git commit -m "add Kenya Hospital Analysis Project" to save the changes with a specific message indicating the nature of the modifications made. They then utilize git log --oneline to view the commit history.

Connecting to GitHub

Lastly, the author establishes a connection to GitHub by adding the SSH using git remote add origin SSH. The SSH content can be directly pasted after the origin. They verify the remote URL has been added correctly using git remote -v and finally push the changes to GitHub using git push -u origin main.

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

Deploying My First Web Server with Nginx

Today I worked on a simple but important DevOps task: deploying a web server using Nginx on Ubuntu. Instead of only learning the theory, I wanted to understand the practical flow of how a web server…

Completion Is an Ownership Boundary

An async method can finish its useful work and still be holding lifecycle state that tells the rest of the system it is active. That sounds like a tiny implementation detail.

More from Sunday 23 August →