Git is a distributed version control system. It tracks changes in your code and allows collaboration.
Why Git?
- Track every change
- Branch and merge
- Collaborate with teams
- Roll back mistakes
Git is a distributed version control system. It tracks changes in your code and allows collaboration.
git init git add . git commit -m "Initial commit" git push origin main
# Initialize a new repository git init # Check status git status # Stage files git add . git add filename.txt # Commit git commit -m "Initial commit" # View log git log --oneline
What command initializes a new Git repository?
git init
What does "git add" do?
git add stages changes for the next commit.
git fetch downloads changes but doesn't merge. git pull fetches and merges in one command.