DEV Community

stanley maina
stanley maina

Posted on

My Two Weeks At Luxe Dev Hq Data Analysis Class: From a Local Folder to GitHub Using Git and SSH

Introduction

Over the past two weeks, I have been learning the basics of Git and GitHub and how they are used in Data science. During the classes, I learned that Git and GitHub are not the same thing. Git moves files to GitHub, while GitHub is an online platform where I can store and manage Git repositories and collaborate with other developers.
One of the most useful things I learned was how to take a project that is stored in a local folder on my computer and connect it to GitHub. I also learned how SSH can be used to securely connect my computer to GitHub.

Setting up SSH

I navigated to my PowerShell on windows and ran the SSH server and authenticated

Creating a folder on the desktop

changing directory to the desktop via cd OneDrive
make a directory via mkdir Data

Creating a Repo on GitHub

On Github.com, I navigated to my profile, clicked on repository and created a repo/copied it
Navigated to settings, SHH and GPG keys

! Image description and copied the public key and tested it on bash

this was a hurdle and took me hours to navigate but with the help of the teachers I managed to overcome this successfully.

Stage,Commit,Push

  1. step one was to git status to show the files that I had via git status- Shows which files are new, modified, or untracked.

  2. Git add . This is basically telling my Git I want to include these changes in my next commit

  3. git commit -m "Initial commit"- Here I was creating a permanent record in my local repo's history, with a message describing what changed.

  4. git push origin main This is the command to basically send it to GitHub

Top comments (0)