How to Use Git & GitHub – Beginner Friendly Guide

1. Git Basics

πŸ”Ή What is Git?

Git is a version control system.
In simple words, Git remembers every change you make in your code.

If:

Your code breaks.

You delete something by mistake.

 

πŸ”Ή Why Git is Important?

Git is important because:

βœ… Keeps backup of your code

βœ… Tracks who changed what and when

βœ… Helps in team work

βœ… Saves project history

βœ… Used by almost all companies

 

πŸ”Ή What is GitHub?

GitHub is an online platform where we store Git projects on the internet.

In simple words:

Git β†’ works on your computer

GitHub β†’ stores your code online

Using GitHub, you can:

Share code with others

Show your work to companies

Work with team members

 

πŸ”Ή Difference Between Git and GitHub

Works locally Works online
Tracks code changes Stores code
Command-line tool Website
No internet needed Internet required

 

 

πŸ”§ Basic Git Workflow (Easy Steps)

1. Create or open project folder

2. Initialize Git

3. Make code changes

4. Save changes (commit)

5. Push code to GitHub

 

πŸ”‘ Common Git Commands (With Simple Meaning)

1️⃣ Initialize Git

git init

πŸ‘‰ Starts Git in your project folder

 

2️⃣ Check File Status

git status

πŸ‘‰ Shows changed, new, or saved files

 

3️⃣ Add Files to Staging

git add .

πŸ‘‰ Tells Git: β€œThese files are ready to save”

 

4️⃣ Save Changes (Commit)

git commit -m “Initial commit”

πŸ‘‰ Saves your changes with a message

 

5️⃣ Connect GitHub Repository

git remote add origin repository_url

πŸ‘‰ Connects local project to GitHub

 

6️⃣ Upload Code to GitHub

git push origin main

πŸ‘‰ Sends your code to GitHub

 

πŸ” GitHub Daily Use Commands

git pull β†’ Download latest code

git clone β†’ Copy project from GitHub

git log β†’ View commit history

 

🧠 Real Life Example

Imagine you are writing a project:

Day 1 β†’ Working code

Day 2 β†’ Code breaks

Day 3 β†’ You panic

With Git: You simply go back to Day 1 code

That’s why Git is very powerful.

 

Conclusion

Git and GitHub are must-learn tools for every developer.They help us:

Manage code properly

Work in teams

Build professional projects

Learning Git early makes you a better and confident developer πŸ’»

 

My GitHub URL :-https://github.com/ThakarShivam175

 

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *