Github beginner's guide


What is Github ?
GitHub is a website and platform where developers store and share their code. Think of it as a "cloud storage for code" that also helps people collaborate on programming projects.
Imagine you’re writing a book with friends. GitHub is like an online notebook where:
Everyone can add their own chapters.
You can see who added what and when.
If someone makes a mistake, you can go back to an earlier version.
You can share the final book with others easily.
so this is the simpliest github explaination. nice!
Why we use Github ?
Code Storage and Backup.
Version Control.
Collaboration.
Open Source contribution.
Portfolio Building.
In short we use it for version control and collaboration, enabling developers to track changes, collaborate on code, and manage projects efficiently. It acts as a centralized repository for storing code, automates workflows with integrations, and serves as a portfolio for showcasing skills, especially for open-source contributions.
Main Components of Github.
Forks: Personal copies of a repository for experimentation or independent development.
Repositories: A repository is a Centralized storage for project code, files, and documentation.
Branches: Branches are the Isolated versions of a project for working on features or fixes without affecting the main codebase. you can also see branches like the tree Branches.
Commits: Snapshots(or Clicked pictures) of changes made to the code, forming the project's version history.
Pull Requests: A feature to propose and review code changes before merging them into the main branch.
Some common commands.
Repositories
Create a Repository:
- On GitHub: Use the "New" button on the Repositories page.
Locally:
git init
- Clone a Repository:
git clone <repository-URL>
Branches
Create a Branch:
git branch <branch-name>
- Switch to a Branch:
git checkout <branch-name>
- Create and Switch to a Branch:
git checkout -b <branch-name>
- List Branches:
git branch
- Delete a Branch:
git branch -d <branch-name>
Forks
- Fork a Repository: Use the "Fork" button on GitHub.
Sync Fork with Original:
git remote add upstream <original-repo-URL>
git fetch upstream
git merge upstream/<branch-name>
General Commands
Push Changes:
git push origin <branch-name>
Pull Changes:
git pull
Merge Branches:
git merge <branch-name>
So these are the basic of the github. if you guys want in detail Video on Github in an very simple way then you need to checkout Kunal Kushwaha’s “Complete Git and GitHub Tutorial” (Highly Recommended). Thankyou for your time.
Subscribe to my newsletter
Read articles from Bhavesh Sharma directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Bhavesh Sharma
Bhavesh Sharma
i am currently starts to learning new things as you can check my progress is blogs.