GitHub from Scratch

Introduction
This blog is for those who are unaware of how to use GitHub. Git is a most popular, free, and open source, distributed version control system that keeps track of several versions of a file or collection of files. Git reduces the process of working with others and makes project collaboration simple. Users obtain exact copy of the source code. If a disaster happens, then a complete source including the version history can be restored from the repository. Team members may work on files and simply merge their modifications into the main branch of the project. Users do not need to utilize GitHub if they simply like to keep records of their code offline. If you wish to collaborate with a team, users may utilize GitHub to alter the project’s code cooperatively. Inside this article, I will guide you through GitHub’s numerous operations and characteristics.
What is Git?

Git is managing changes to a source and those changes are identified using a revision number. Each revision has its timestamp as well as the person who has done the change. These revisions can be restored, compared, and merged.
Terminology
- Repository: - Project’s folder. A repository contains all the project files and stores each file’s revision history.
- Branch: - Copy of the master branch taken at a given point. A branch will handle all feature developments and fix bugs. Various branches can usually exist simultaneously.
- Commit: - Take a copy of the modifications being done to the files.
- Push: - Send your committed changes to a remote repository.
- Pull: - If there are any changes in the remote repository, it will update your local files and folders Also merge those changes
- Merge: - Integrate branches to update the main branch.
If you want to know more about terminology click here GitHub glossary — GitHub Docs
Accessing GitHub
Prerequisites: Install the git to your PC and configure it with this guide Set up Git — GitHub Docs
If you do not have a github account, create a github account with your email address.

Tips: Enter a unique username. You can use alphanumeric characters for your username.
If you already have an account, sign in to the account with your credentials.

Creating a Repository
Click the + and select New repository

It will appear like this

First fill the repository name

Tips: Don’t worry if the repository name already exists on your account it will show an error message.
If you want to make it unique use hyphen (-) or underscore( _ )

Tips: Don’t use number characters. It will make your repository name a mess.
The description is optional. If you need it, you can add it. And then choose the visibility. If you choose public, the repository will visible to everyone. In contrast , if you choose private it is only visible to you. Also, you can choose who can see the repository.

Then initialize the repository with README, .gitignore and license.

Add a README file: It contains a long description about your project. You can edit this file with markdown language. You can use this link Getting Started | Markdown Guide
Add .gitignore: This file contains a list of files and folders, which should be ignored during GitHub tracking.
Choose a license: It is an advance option for beginners. The license consist of what users may and may not do with the code.
After completion of the above procedure, click create repository.

Given above is an empty GitHub repository. These are the basic commands to push your program into a repository.
git init
git add README.md
git commit -m “first commit”
git branch -M main
git remote add origin https://github.com/uabinesh/test-copy.git
git push -u origin main
git init: Initiate github repository for the project on your PC
git add: Add files for tracking the version history
git commit: Take a record into the version history
git branch: Create a new branch
git remote: Specify the remote URL for your project
git push: Send all local branches to Github
Tips: Among these commands,
git init
andgit remote
is used only once in your project. If you change your remote link then usegit remote
References
How To Use GitHub | GitHub Tutorial For Beginners | Edureka
An Intro to Git and GitHub for Beginners (Tutorial) (hubspot.com)