DEV Community

Cover image for Getting to know Git and Github
SHARON CHEROCK
SHARON CHEROCK

Posted on

Getting to know Git and Github

Definitions

Git - A version control tool used to track changes in computer files.
Github - A web-based platform where you can store Git repositories allowing you to store, manage, track and share codes.

  1. Installing Git and Gitbash
  • Go to https://git-scm.com, install the latest version and make sure to choose the correct operating system. Continue to signing up.

  • To access Gitbash, search on your computer and you will get a terminal.

  1. Configuring On GitBash This is to ensure that Git recongnizes you. Ensure the email you will use is the same email as the one you are signed on in Git.
git config --global user.name "name"
git config --global user.email "emailyours@email"
Enter fullscreen mode Exit fullscreen mode

You can check if your configurations have picked using this command
git config --list

  1. Generate SSH key and add an Agent

.Use this command to generate a key
ssh-keygen -t ed25519 -C "sharoncherock1@gmail.com"

.Adding an agent
eval "$(ssh-agent -s)"

4.Adding your Key to Github

.Copy your key
.On Github, click on your profile, go to Settings
Scroll to SSH and GPG Keys, tap on New SSH Key
.Name your key and paste the key in the box. Then tap the Add SSH Key.

  1. Git Push and Pull. .First, create a repository. On your Github account, tap on the + sign and click on New Repository. Give it a name and make its visibility to your preference. Click the Add A README file. Click on Add Repository

Commands used;
git push -u origin main

The purpose is to link the local repository to remote repository

git pull origin main

In conclusion, just start, we will get better with practice. I hope this articles gives you some little insights and you can comment for more engagements and learning together.

Top comments (0)