Hey Beautiful people ❤
Thanks for taking the time to read my blog😊
We'll be learning about Git, Need of Git, Git Vs Github, VCS, basic git commands
Let's get started!
hey anjali, WHY SHOULD I BOTHER ABOUT GIT & GITHUB 🤨?
Imagine your manager asks you to make a wireframe of a website. You make various folders named animation, UI, Admin, iteration1, iteration 2..... etc. Iteration refers to the enhanced versions after consulting to manager.
Suddenly one day manager asks you to day7 UI was nice, want to proceed with it.
and rug swept from your feet, You absolutely don't have an idea on day 7 what was the code as there is clutter of files in your system with almost no space in memory.
GIT : VERSION CONTROL SYSTEM
Git is like Tree
As Tree has the main Trunk and other small branches attached to it.
Similarly, Git has a main branch (master) and other branches are attached to it. If these other branches get approved, they merge to the master branch.
DISTRIBUTED VERSION CONTROL SYSTEM (VCS)
These systems do not necessarily rely on a central server to store all the versions of a project's files.
Every user has a local copy of the repository in addition to the central repo on the server-side.
3 STAGES OF GIT WORKFLOW
Imagine shopping for clothes on Amazon. You select your choice(git add ),
add those into the cart (staging area),
staging area means that these are the only changes I want to proceed with further.
and finally order/payment (git push).
BASIC GIT COMMANDS
Git is initialised through terminal. Install git bash from here
$ git init
This downloads hidden files in the project folder.
Choosing Files to share
git add yourfilename
or
git add .
this one add all the files
We will save the selected files with a message. Then we ready to share them.
$ git commit -m ''Added my files"
m means message
git remote add origin remote URL
remote URL can be found from github
git push origin master
git status
With this you can see modified files
git log
you or anyone can see commit messages