Git Complete Guide 🧠

Version Control System for Developers

1. What is Git?

Git is a version control system used to track code changes and collaborate with other developers.

2. Setup

git --version
git config --global user.name "Your Name"
git config --global user.email "email@example.com"

3. Initialize Repo

git init

4. Check Status

git status

5. Add Files

git add .
git add index.html

6. Commit

git commit -m "first commit"

7. Branching

git branch feature
git checkout feature

8. Merge

git merge feature

9. GitHub

git remote add origin https://github.com/user/repo.git
git push -u origin main

10. Clone Repo

git clone https://github.com/user/repo.git

11. Pull Updates

git pull origin main

12. Git Workflow

1. git init
2. git add .
3. git commit -m "message"
4. git push