DEV Community

Gichanga Wangui
Gichanga Wangui

Posted on

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

Installation And Setup Of Relevant Environments And User Accounts Creation

We begin the project by downloading Git bash from Git Website website and installation of the downloaded software. We proceed to create an account by signing up on Github.
We then proceed to configure and initialize username and e-mail address on Git bash by running git config command so that the identity of the user is correctly setup.

SSH Setup

We create an SSH Key which is a form of authentication that is used when pushing project from the local machine to the Github Repository. We achieve this by running the

ssh-keygen -t ed25519 -C
Enter fullscreen mode Exit fullscreen mode

We proceed to copy the generated SSH Key and paste it on Github under SSH and GPG Keys section.
Once the SSH Key is authenticated, we test the connection and if successful, we proceed to verify the details by keying in a verification message sent to the registered e-mail address which returns a “success” message if the process is done correctly.

Gitbash

Git bash is a terminal that will help in executing commands throughout the project.
We go to git bash and create create project folders and files like Data, README.md, and scripts among others using MkDIR and Touch commands.
To work on the README.md file, there are two methods using “Nano” or “Echo” commands.
Nano opens a “separate” working area where the user can proceed to document the project.
Echo command runs within the Git bash terminal.
If working on a project using Ms Excel project, we can move the file to the Data folder using clip command or by copying it from File explorer.

Working With Commits

~ Git commit -m which explains what is saved thereby making it easy to understand the History of the project.
~ Git Log helps the user see the history on the commit
~ Git branch / Git main which shows the branch where the project is located / saved.

Creating a Github Repository

We create a Github repository by tapping the + button and then choosing “New repository” and then giving the repository a name.

Connecting / Pushing The project to Github

We open Git bash and run git remote command in this format git remote add origin git@github.com followed by the Github username.

We then proceed to run Git remote command which will provide a communication channel for the project on the computer and Git hub and upload the project.

The final stage of the project is to verify the project which we achieve by refreshing the Github page.

If the project upload was successful will have the various files and folders displayed on the Github Repository.

Top comments (0)