Git for Beginners: Basics and Essential Commands
What is Git?
Ans-> Git is a distributed version control system.
It helps developers save code changes, track history, and work safely without losing files.
Every developers has a copy of the project on their computer.
Why Git is Used?
Ans-> Git is used to:
a) Track code changes
b) Work in a team
c) Go back to older version
d) Keep code safe
Git Basics and core terminologies?
Ans->
a) Repository (Repo)
-> A folder where Git track files.
b) Commit:
-> A saved version of your code.
c) Branch:
-> A separate version of code to work on new features.
d) HEAD:
-> Points to the current commit
Common Git Commands?
Ans-> Initialize Git = git init,
Check file status = git status,
Add files = git add,
Save changes = git commit -m “message”,
View history git log
Basic Git workflow (From start)
a) Create project folder
b) Initialize Git
c) Write code
d) Add files
e) Commit changes