LEARN ABOUT THE GIT AND GIT HUB WITH A NEWBEE
#02
This is krish a 'newbee' still learning about Git and Github . In this blog I'll try my best to explain whatever i know about git and github in the way I learned .
What is git and github ?
Git :
Git is a tool that helps us to track down the changes we made in our codes by saving each changes in different versions. (For our understanding lets say the unchanged code as version 1 and the 1st changed or edited code as version 2 .)
It will be saved locally i.e.,within the computer
Git doesn’t save your work automatically — you have to tell it when to save a version. Here’s how it works:
-
You make changes to your files (like editing code or adding new files).
2.You tell Git to save those changes by giving the command in the git bash .
The command:
Git will then save a version of your project. You get to decide when to save (or commit) your work!
Github :
- Github is a web source where we store and share our code online .
- Just like Git , we have to save manually in github too by giving a command in the git bash after we make changes .
Steps to save changes to GitHub:
-
Make changes to your files (like editing code).
-
Commit the changes locally with
git commit -m "your message". -
Push the changes to GitHub with the command :
So:
-
git commitsaves locally. -
git pushsends those changes to GitHub.
-
Take a look at the table below for better understanding
| 🔹 Feature | Git | GitHub |
|---|---|---|
| What is it? | A tool/software | A website/platform |
| Where is it used? | On your computer (offline) | On the internet (online) |
| Main job | Tracks changes in your code | Stores and shares code online |
| Who uses it? | Just you, on your machine | You and others (team/collab) |
| Saves changes? | Yes, locally | Yes, remotely (online) |
| Needs internet? | ❌ No | ✅ Yes |
| Commands used | git commit -m"your message" | git push |
| Visual interface? | No (mostly command-line) | Yes (a full website) |
Comments
Post a Comment