- 🌐 What is GitHub?
GitHub is a website where developers store their code. Imagine Google Drive, but made just for coding projects. It allows you to upload your code, save versions of it, and even work on the same code together with your teammates or friends — all online. GitHub helps keep your code safe and accessible from anywhere.
- 🔧 What is Git?
Git is a tool that works on your computer, and it tracks all the changes you make in your project. Think of Git like a time machine for your code — you can go back to an earlier version if something breaks, or you can check what changes were made and when. GitHub and Git work hand-in-hand. Git tracks your code locally, and GitHub is where you upload it to the internet.
- 🧠 Common Git Terms
- Repository (Repo): A folder where your project and code live.
- Commit: Saving your progress with a short message.
- Push: Sending your committed code to GitHub.
- Pull: Getting the latest code from GitHub to your PC.
- Clone: Copying a GitHub repo to your computer.
- 💻 How to Push Code from VS Code to GitHub
Let’s say you made a project in VS Code and now you want to upload it to GitHub. Here’s a simple step-by-step guide:
✅ Step 1: Create a GitHub Account
Go to https://github.com
Sign up with your email.
✅ Step 2: Create a Repository
Click the "+" icon on GitHub and select "New repository".
Give it a name like my-first-project.
Click "Create repository".
Keep the page open.
✅ Step 3: Open Your Project in VS Code
Launch VS Code and open your project folder.
✅ Step 4: Initialize Git in Your Project
Open the terminal (Ctrl + ~ in VS Code).
Type: git init
✅ Step 5: Link GitHub Repo
Copy your GitHub repo URL.
In terminal: git remote add origin
✅ Step 6: Add Your Files
Type: git add .
✅ Step 7: Commit the Changes
Type: git commit -m "My first commit"
✅ Step 8: Push to GitHub
Type: git branch -M main
Then: git push -u origin main
Now your project is online! 🎉
- 🔁 Next Time You Make Changes
Use these 3 commands to update your GitHub repo:
- git add .
- git commit -m "your message"
- git push
💡 Final Thoughts
At first, all of this might sound like a lot. But once you try it a couple of times, it becomes easy. Git and GitHub are essential skills every developer needs. They help you save your work, work with teams, and keep your code safe. Think of GitHub as your online locker and Git as your organizer.
Thanks for reading! If this guide helped you, save it, share it with friends, and revisit whenever you forget the steps. Everyone starts somewhere — today it's your first push, tomorrow you're collaborating with coders around the world!
Learning through @devsync
Top comments (0)