© Khmer Angkor Academy - sophearithput168

សេចក្តីផ្តើម Git & GitHub

Git & GitHub គឺជាអ្វី? 🔄

Git គឺជា Version Control System (VCS) ដែលអនុញ្ញាតឱ្យយើងតាមដាន changes របស់ code និងធ្វើការជាក្រុមបានយ៉ាងមានប្រសិទ្ធភាព។ GitHub គឺជា platform សម្រាប់រក្សាទុក និងចែករំលែក Git repositories លើ cloud។

🌟 ហេតុអ្វី Git ចាំបាច់?

  • 📂 Track Changes - តាមដានគ្រប់ changes ទាំងអស់
  • ⏮️ Undo Mistakes - ត្រឡប់ទៅកំណែមុន
  • 👥 Collaboration - ធ្វើការជាក្រុម
  • 🔄 Backup - Code safe នៅលើ cloud
  • 🌐 Portfolio - បង្ហាញគម្រោងរបស់អ្នក

🎯 Git vs GitHub

Git GitHub
📦 Software/Tool 🌐 Website/Service
💻 Local (Computer) ☁️ Cloud (Internet)
🔄 Version Control 🤝 Hosting & Collaboration
Offline ធ្វើការបាន Online ត្រូវការ

💡 Version Control គឺជាអ្វី?

ស្រមៃថាអ្នកកំពុងសរសេរ essay ហើយ save ជាច្រើន versions:

❌ Without Version Control:
essay_final.docx
essay_final_v2.docx
essay_final_v2_REAL.docx
essay_final_v2_REAL_THIS_ONE.docx
😱 អ្វីដែលជា version ចុងក្រោយ?

✅ With Git:
essay.docx
- Version 1: "Introduction written"
- Version 2: "Added conclusion"
- Version 3: "Fixed grammar"
🎯 ច្បាស់លាស់ និង organized!

📚 ប្រវត្តិសាស្ត្រ

  • 2005: Linus Torvalds បង្កើត Git សម្រាប់ Linux development
  • 2008: GitHub ត្រូវបានចាប់ផ្តើម
  • 2018: Microsoft ទិញ GitHub ក្នុងតម្លៃ $7.5 billion
  • 2023-2025: 100+ million developers នៅលើ GitHub

🎯 Git Basic Concepts

1. 📦 Repository (Repo)

folder ដែល Git តាមដាន - មាន code និង history ទាំងអស់។

2. 💾 Commit

Snapshot របស់ code នៅពេលជាក់លាក់មួយ - ដូច save point។

# Make changes to files
git add .
git commit -m "Added login feature"

3. 🌿 Branch

ផ្លូវដាច់ដោយឡែកសម្រាប់ develop features ថ្មី។

# Create new branch
git branch feature-login

Switch to branch

git checkout feature-login

Or create and switch at once

git checkout -b feature-login

4. 🔀 Merge

រួមបញ្ចូល changes ពី branch មួយទៅ branch មួយទៀត។

# Merge feature into main
git checkout main
git merge feature-login

🌐 GitHub Features

1. 📂 Remote Repositories

រក្សាទុក code នៅលើ cloud - access ពីគ្រប់ទីកន្លែង!

2. 👥 Collaboration

  • 🤝 Pull Requests - Propose changes
  • 💬 Code Review - Review ដោយក្រុម
  • 🐛 Issues - Track bugs & features
  • 📋 Projects - Project management

3. 🚀 GitHub Actions

Automate testing, building, និង deployment!

4. 📄 Documentation

README.md files, Wiki, GitHub Pages

🏢 ក្រុមហ៊ុនប្រើ Git & GitHub

  • 🔷 Microsoft - VS Code, TypeScript
  • 📘 Facebook - React, React Native
  • 🎨 Google - TensorFlow, Flutter
  • ⚛️ Every tech company!

💼 Git Workflow ពេញនិយម

# 1. Clone repository
git clone https://github.com/username/project.git

2. Create branch

git checkout -b my-feature

3. Make changes & commit

git add . git commit -m "Add new feature"

4. Push to GitHub

git push origin my-feature

5. Create Pull Request on GitHub

6. After review, merge to main

7. Delete branch

git branch -d my-feature

🎯 Git Commands ចាំបាច់

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

Initialize

git init

Status & Changes

git status git diff git log

Save Changes

git add <file> git add . git commit -m "message"

Branches

git branch git branch <name> git checkout <name> git merge <branch>

Remote

git remote add origin <url> git push origin main git pull origin main git clone <url>

🚀 អ្វីដែលអ្នកនឹងរៀន

  1. 📦 Git Installation - ដំឡើង Git
  2. 🔧 Configuration - Setup Git
  3. 📝 Basic Commands - add, commit, push
  4. 🌿 Branching & Merging
  5. 🔄 GitHub Collaboration
  6. 🐛 Issues & Pull Requests
  7. GitHub Actions
  8. 🚢 Deployment

🎉 Ready? Git & GitHub គឺជា essential tools សម្រាប់ developer ទាំងអស់! តោះចាប់ផ្តើម! 🚀

1

🎯 សំណួរលឿន

1 / 1

Git commit ធ្វើអ្វី?