Beginner 2 min read

๐Ÿš€ Git & GitHub Beginner Guide (2026)

Learn version control step-by-step โ€” perfect for students & beginners ๐Ÿ‘จโ€๐Ÿ’ป


๐Ÿ“Œ What is Git?

Git is a tool that helps you: - Track changes in your code ๐Ÿ“Š
- Go back to previous versions โช
- Work safely without losing data

๐Ÿ‘‰ Think of Git as a save history system for your code.


๐ŸŒ What is GitHub?

GitHub is a platform where: - You store your code online โ˜๏ธ
- Share projects ๐Ÿค
- Collaborate with others ๐ŸŒ


โš™๏ธ Step 1: Install Git

Download Git: https://git-scm.com/downloads

Check installation:

git --version

๐Ÿ› ๏ธ Step 2: Configure Git

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

๐Ÿ“ Step 3: Initialize Repository

cd your-project-folder
git init

๐Ÿ“ฆ Step 4: Add Files

Add all files:

git add .

Add specific file:

git add file.txt

๐Ÿ’พ Step 5: Commit Changes

git commit -m "Initial commit"

๐Ÿ”— Step 6: Connect to GitHub

git remote add origin https://github.com/username/repo.git

๐Ÿš€ Step 7: Push Code

git branch -M main
git push -u origin main

๐Ÿ”„ Common Commands

git status      # Check changes
git log         # View history
git pull        # Get updates
git clone URL   # Download repo

โš ๏ธ Common Errors & Solutions

โŒ Permission denied (publickey)

ssh-keygen -t ed25519 -C "your@email.com"

๐Ÿ‘‰ Add SSH key to GitHub


โŒ Authentication failed

๐Ÿ‘‰ Use Personal Access Token instead of password
๐Ÿ‘‰ Or switch to SSH authentication


โŒ Nothing to commit

git add .
git commit -m "message"

๐Ÿ’ก Pro Tips

  • Commit frequently โœ”๏ธ
  • Write clear commit messages ๐Ÿง 
  • Always pull before push ๐Ÿ”„
  • Never upload sensitive data ๐Ÿšซ

๐ŸŽฏ Conclusion

Now you know: - Git basics
- How to track code
- How to push to GitHub

๐Ÿ”ฅ Practice daily and become pro ๐Ÿš€