🐙 AI + GitHub — AI กับ GitHub

Learn How AI Assists Coding on GitHub — เรียนรู้วิธีที่ AI ช่วยเขียนโค้ดบน GitHub

Week 5 · Passive Voice (be + V3) · AI + GitHub Part 1

🎯 GitHub Copilot คืออะไร?
What is GitHub Copilot & AI-Assisted Coding?

🇹🇭 ภาษาไทย

GitHub คือแพลตฟอร์มสำหรับจัดเก็บและจัดการโค้ดโปรแกรม นักพัฒนาทั่วโลกใช้ GitHub เพื่อทำงานร่วมกันบนโปรเจกต์ซอฟต์แวร์


GitHub Copilot คือเครื่องมือ AI ที่ช่วยเขียนโค้ดให้คุณ มัน ถูกฝึก (was trained) จากโค้ดหลายล้านบรรทัด และสามารถ แนะนำโค้ด (suggest code) ให้คุณขณะพิมพ์


เมื่อ AI ถูกใช้ร่วมกับ GitHub ขั้นตอนการเขียนโค้ดจะ ถูกเร่งให้เร็วขึ้น — commit messages ถูกเขียนโดย AI, โค้ดถูกตรวจสอบโดยอัตโนมัติ, และ bugs ถูกพบได้เร็วขึ้น

🇬🇧 English

GitHub is a platform for storing and managing code. Developers around the world use GitHub to collaborate on software projects.


GitHub Copilot is an AI tool that helps you write code. It was trained on millions of lines of code and can suggest code as you type.


When AI is used with GitHub, the coding process is accelerated — commit messages are written by AI, code is reviewed automatically, and bugs are found faster.

🌟 Fun Facts — ข้อเท็จจริงน่าสนใจ

  • Over 100 million developers are registered on GitHub — มีนักพัฒนากว่า 100 ล้านคนบน GitHub!
  • GitHub Copilot was created by GitHub and OpenAI together — Copilot ถูกสร้างโดย GitHub และ OpenAI ร่วมกัน
  • More than 1 billion suggestions have been accepted by Copilot users — มีการยอมรับคำแนะนำมากกว่า 1 พันล้านครั้ง
  • The name "Git" was chosen by Linus Torvalds — the creator of Linux — ชื่อ "Git" ถูกเลือกโดย Linus Torvalds ผู้สร้าง Linux

🇹🇭 ทำไมต้องเรียน AI + GitHub?

  • GitHub ถูกใช้โดยบริษัทเทคโนโลยีทุกแห่ง
  • Commit messages ถูกเขียนเป็นภาษาอังกฤษ — ฝึกภาษาได้!
  • โค้ดถูกตรวจสอบ (reviewed) ด้วย AI ได้เร็วขึ้น
  • เป็นทักษะสำคัญที่ถูกต้องการในตลาดงาน

🇬🇧 Why Learn AI + GitHub?

  • GitHub is used by every tech company in the world
  • Commit messages are written in English — great practice!
  • Code is reviewed faster with AI assistance
  • It is a skill that is required in the job market

🧪 Section Check — ตรวจสอบความเข้าใจ

GitHub & AI Basics — พื้นฐาน GitHub และ AI

0/3

GitHub Copilot ______ on millions of lines of code before it could suggest code to developers.

GitHub Copilot ______ จากโค้ดหลายล้านบรรทัดก่อนที่จะแนะนำโค้ดให้นักพัฒนาได้

is trained
was trained
has train
✅ "was trained" — Past passive (was + V3). Copilot ถูกฝึกในอดีต ก่อนที่จะใช้งานได้ จึงใช้ past passive voice

Which sentence correctly uses passive voice to describe what happens on GitHub?

ประโยคไหนใช้ passive voice ถูกต้องเพื่ออธิบายสิ่งที่เกิดขึ้นบน GitHub?

Commit messages are written by AI.
Commit messages is written by AI.
Commit messages are write by AI.
✅ "Commit messages are written by AI." — Present passive: are + V3 (written). ใช้ "are" เพราะ messages เป็นพหูพจน์ และต้องใช้ V3 (written) ไม่ใช่ base form

What is the main advantage of using AI with GitHub?

ข้อดีหลักของการใช้ AI กับ GitHub คืออะไร?

GitHub is deleted faster with AI.
The coding process is accelerated — bugs are found faster.
Code is hidden by AI from other developers.
✅ AI ช่วยเร่งกระบวนการเขียนโค้ด — bugs ถูกพบเร็วขึ้น, commit messages ถูกเขียนโดย AI, และโค้ดถูกตรวจสอบอัตโนมัติ

📚 คำศัพท์สำคัญ
Key Vocabulary

📁 Repository
คลังเก็บโค้ด / รีโพ
A folder where your project files are stored and tracked by Git.
โฟลเดอร์ที่ไฟล์โปรเจกต์ถูกจัดเก็บและติดตามโดย Git
💾 Commit
คอมมิต / บันทึกการเปลี่ยนแปลง
A saved snapshot of your changes. Each commit is recorded with a message.
การบันทึกสแนปช็อตของการเปลี่ยนแปลง แต่ละ commit ถูกบันทึกพร้อมข้อความ
⬆️ Push
พุช / ส่งโค้ดขึ้น
To upload your commits from your computer to GitHub.
การอัปโหลด commit จากคอมพิวเตอร์ของคุณไปยัง GitHub
⬇️ Pull
พูล / ดึงโค้ดลง
To download changes from GitHub to your computer.
การดาวน์โหลดการเปลี่ยนแปลงจาก GitHub มายังคอมพิวเตอร์ของคุณ
🌿 Branch
สาขา / แบรนช์
A separate version of your code where new features are developed without affecting the main code.
เวอร์ชันแยกของโค้ดที่ฟีเจอร์ใหม่ถูกพัฒนาโดยไม่กระทบโค้ดหลัก
🔀 Merge
รวม / ผสาน
To combine changes from one branch into another.
การรวมการเปลี่ยนแปลงจาก branch หนึ่งเข้ากับอีก branch
📋 Pull Request
คำขอรวมโค้ด / PR
A request to merge your changes into the main branch. It is reviewed by other developers.
คำขอรวมการเปลี่ยนแปลงของคุณเข้าสู่ branch หลัก ถูกตรวจสอบโดยนักพัฒนาคนอื่น
🔍 Code Review
การตรวจสอบโค้ด
The process where code is examined by other people or AI before it is accepted.
กระบวนการที่โค้ดถูกตรวจสอบโดยคนอื่นหรือ AI ก่อนที่จะถูกยอมรับ
🤖 Copilot
โคไพลอต / ผู้ช่วย AI
An AI assistant made by GitHub that helps you write code by suggesting completions.
ผู้ช่วย AI ที่สร้างโดย GitHub ช่วยเขียนโค้ดโดยแนะนำการเติมเต็ม
💡 Suggestion
คำแนะนำ / ข้อเสนอ
A recommendation or idea offered by AI. Code suggestions are shown while you type.
คำแนะนำหรือไอเดียที่เสนอโดย AI คำแนะนำโค้ดถูกแสดงขณะคุณพิมพ์
⚡ Autocomplete
เติมข้อความอัตโนมัติ
When AI automatically finishes your code or text as you type.
เมื่อ AI เติมโค้ดหรือข้อความให้อัตโนมัติขณะที่คุณพิมพ์
🔄 Version Control
การควบคุมเวอร์ชัน
A system that tracks all changes made to files over time. Every change is recorded.
ระบบที่ติดตามการเปลี่ยนแปลงทั้งหมดที่ทำกับไฟล์ ทุกการเปลี่ยนแปลงถูกบันทึก

🧪 Section Check — ตรวจสอบความเข้าใจ

Vocabulary & Passive Voice — คำศัพท์และ Passive Voice

0/3

A ______ is a saved snapshot of your changes. Each one ______ with a message.

______ คือสแนปช็อตที่บันทึกการเปลี่ยนแปลงของคุณ แต่ละอัน____พร้อมข้อความ

branch ... is write
push ... was recording
commit ... is recorded
✅ A commit is a saved snapshot. Each one "is recorded" (present passive: is + V3) with a message. — commit คือการบันทึกการเปลี่ยนแปลง ถูกบันทึกพร้อมข้อความ

What does "push" mean in GitHub?

"push" ใน GitHub หมายถึงอะไร?

To upload your commits from your computer to GitHub
To download changes from GitHub to your computer
To delete a repository from GitHub
✅ Push = อัปโหลด commit จากคอมพิวเตอร์ไปยัง GitHub (ส่งโค้ดขึ้น) ส่วน pull = ดาวน์โหลดจาก GitHub มายังคอมพิวเตอร์

New features ______ on a separate branch without affecting the main code.

ฟีเจอร์ใหม่______บน branch แยกโดยไม่กระทบโค้ดหลัก

is developed
are developed
are develop
✅ "are developed" — features เป็นพหูพจน์จึงใช้ "are" + V3 (developed) ห้ามใช้ "is" กับพหูพจน์ และต้องใช้ V3 ไม่ใช่ base form

📖 ไวยากรณ์ในบริบท GitHub
Grammar in Context: Passive Voice

🔤 Passive Voice: be + past participle (V3)

Passive Voice (ประโยคถูกกระทำ) ใช้เมื่อเราต้องการเน้น สิ่งที่ถูกกระทำ มากกว่าผู้กระทำ เหมือนคำว่า "ถูก" ในภาษาไทย

โครงสร้าง: Subject + be + past participle (V3) + (by + ผู้กระทำ)

Present: is/am/are + V3 | Past: was/were + V3 | Present Perfect: has/have been + V3

Active → Passive (Present):

Active: AI writes the code.

✅ Passive: The code is written by AI.

โค้ดถูกเขียนโดย AI

Active → Passive (Past):

Active: The developer created the repository yesterday.

✅ Passive: The repository was created yesterday.

repository ถูกสร้างเมื่อวาน

Active → Passive (Present Perfect):

Active: The team has fixed the bug.

✅ Passive: The bug has been fixed.

บั๊กถูกแก้ไขแล้ว

❌ The code is write by AI.✅ The code is written by AI.

ต้องใช้ past participle (V3) หลัง be เสมอ ไม่ใช่ verb ปกติ

❌ The bug has been fix.✅ The bug has been fixed.

Present perfect passive: has/have + been + V3

💡 Grammar Tip — เคล็ดลับไวยากรณ์

Thai: Passive voice เหมือนการใช้ "ถูก" ในภาษาไทย: "โค้ดถูกเขียน" = "The code is written". จำง่ายๆ: be + V3 เสมอ!

English: Passive voice is very common in tech documentation: "The file is saved", "The bug was found", "Changes have been pushed". The doer (by...) can be omitted.

🇹🇭 สรุปโครงสร้าง Passive Voice

  • Present passive: is/am/are + V3 — "The code is reviewed."
  • Past passive: was/were + V3 — "The repo was created."
  • Present perfect passive: has/have been + V3 — "The bug has been fixed."
  • Active → Passive: ย้าย object มาเป็น subject แล้วใช้ be + V3
  • by + ผู้กระทำ: ใส่หรือไม่ใส่ก็ได้ ถ้าไม่สำคัญ

🇬🇧 Passive Voice Summary

  • Present: is/am/are + V3 — "Code is pushed to GitHub."
  • Past: was/were + V3 — "The branch was merged."
  • Present Perfect: has/have been + V3 — "The PR has been approved."
  • Active → Passive: Move the object to subject position, add be + V3
  • "by" agent: Optional — include only when the doer is important

🧪 Section Check — ตรวจสอบความเข้าใจ

Passive Voice Grammar — ไวยากรณ์ Passive Voice

0/3

The repository ______ yesterday by the developer.

Repository ______เมื่อวานโดยนักพัฒนา

is created
was created
has created
✅ "was created" — ใช้ past passive (was + V3) เพราะมีคำว่า "yesterday" บ่งบอกอดีต "has created" เป็น active voice ไม่ใช่ passive

Which sentence is INCORRECT passive voice?

ประโยคไหนใช้ passive voice ผิด?

The bug has been fixed by the team.
The code is write by AI.
The PR has been approved.
✅ "The code is write by AI" ผิด! ต้องเป็น "The code is written by AI" — ต้องใช้ V3 (written) หลัง be เสมอ ไม่ใช่ base form (write)

The bug ______ by the team. (Present perfect passive)

บั๊ก______โดยทีม (Present perfect passive)

is fixed
was been fixed
has been fixed
✅ "has been fixed" — Present perfect passive: has/have + been + V3 โครงสร้างที่ถูกต้องคือ has been fixed ไม่ใช่ "was been" (ผิดหลัก)

🚀 เริ่มต้นใช้งาน
Getting Started: Setting Up GitHub with AI Tools

🇹🇭 สิ่งที่ต้องเตรียม

  • คอมพิวเตอร์ที่เชื่อมต่ออินเทอร์เน็ต
  • บัญชี GitHub (สร้างฟรีที่ github.com)
  • Text editor เช่น VS Code (ถูกแนะนำ)
  • AI chatbot เช่น ChatGPT หรือ Claude

🇬🇧 What You Need

  • A computer with internet access
  • A GitHub account (created free at github.com)
  • A text editor like VS Code (recommended)
  • An AI chatbot like ChatGPT or Claude

1สร้างบัญชี GitHub — Create a GitHub Account

ไปที่ github.com แล้วคลิก "Sign up" บัญชีจะถูกสร้างฟรี กรอกอีเมล ตั้งรหัสผ่าน และเลือก username
English: Go to github.com and click "Sign up." A free account will be created. Enter your email, set a password, and choose a username.

2สร้าง Repository แรก — Create Your First Repository

คลิกปุ่ม "New" เพื่อสร้าง repository ใหม่ ตั้งชื่อ เช่น "my-first-repo" ติ๊กเลือก "Add a README file" แล้วคลิก "Create repository"
English: Click the "New" button to create a new repository. Name it "my-first-repo", check "Add a README file", then click "Create repository."
// Your repository is created! — repository ของคุณถูกสร้างแล้ว! // In passive voice: "The repository was created by you." // ในรูป passive: "Repository ถูกสร้างโดยคุณ"

3ใช้ AI เขียน README — Use AI to Write a README

เปิด AI chatbot แล้วขอให้เขียน README ให้คุณ AI จะสร้างเนื้อหาที่สามารถคัดลอกไปวางใน GitHub ได้เลย
English: Open an AI chatbot and ask it to write a README for you. The content will be generated by AI and can be copied to GitHub.
// Ask AI to generate a README — ขอให้ AI สร้าง README "Please write a README.md for my GitHub repository called 'my-first-repo'. It is a project for learning AI and English. Use simple English with Thai translation." // The README is written by AI! (passive voice)

4ทำ Commit แรก — Make Your First Commit

แก้ไขไฟล์ README แล้วคลิก "Commit changes" เขียน commit message เช่น "Update README with AI-generated content" การเปลี่ยนแปลงจะถูกบันทึก
English: Edit the README file and click "Commit changes." Write a commit message like "Update README with AI-generated content." The changes will be saved.

5ใช้ AI ตรวจสอบโค้ด — Use AI for Code Review

คัดลอกโค้ดจาก repository แล้ววางลงใน AI chatbot ขอให้ AI ตรวจสอบ — ข้อผิดพลาดจะถูกพบและแนะนำการแก้ไขโดย AI
English: Copy code from your repository and paste it into an AI chatbot. Ask AI to review it — errors will be found and fixes will be suggested by AI.
// Ask AI to review your code — ขอให้ AI ตรวจโค้ด "Please review this code for errors and suggest improvements: [paste your code here] Use passive voice in your feedback. For example: 'The variable should be renamed' or 'An error was found on line 5'."

💡 Pro Tip — เคล็ดลับมือโปร

Thai: บอก AI ว่า "Please write the commit message in passive voice" แล้ว AI จะเขียน เช่น "A new feature was added" แทน "I added a new feature" — ฝึก passive voice ไปในตัว!

English: Ask AI to write commit messages in passive voice: "A new feature was added" instead of "I added a new feature" — practice grammar while coding!

🛠️ โปรเจกต์ลงมือทำ
Hands-On Project: Create a Repo & Use AI to Review Code

🐙

Create a Repository & AI Code Review — สร้าง Repo และใช้ AI ตรวจโค้ด 🌱 Easy

เป้าหมาย: สร้าง GitHub repository ใหม่ ใช้ AI เขียน README และ commit message แล้วให้ AI ตรวจสอบโค้ดโดยใช้ passive voice

ทำตามขั้นตอนอย่างน้อย 3 ข้อ แล้วบันทึกผลลัพธ์

Goal: Create a new GitHub repository, use AI to write a README and commit messages, then have AI review code using passive voice.

Complete at least 3 steps and record your results.

// Project steps using Passive Voice // ขั้นตอนโปรเจกต์โดยใช้ Passive Voice 1. "A new repository is created on GitHub." 2. "A README file is written by AI." 3. "The README is committed to the repository." 4. "The code is reviewed by AI for errors." 5. "Suggestions are provided by AI to improve the code." // Describe your results in passive voice! "The project was completed successfully. Two files were created. Three commits were made. The code was reviewed by AI."

⚠️ Remember / จำไว้นะ

Thai: อย่าแชร์ข้อมูลส่วนตัว (เช่น รหัสผ่าน, API keys) บน GitHub! Repository สาธารณะ ถูกเห็นโดยทุกคน

English: Never share personal information (like passwords or API keys) on GitHub! Public repositories are seen by everyone.

🧪 Section Check — ตรวจสอบความเข้าใจ

Getting Started & Projects — เริ่มต้นและโปรเจกต์

0/2

The README ______ by AI and can be copied to your GitHub repository.

README ______โดย AI และสามารถคัดลอกไปยัง GitHub repository ของคุณได้

is generate
is generated
are generated
✅ "is generated" — README เป็นเอกพจน์จึงใช้ "is" + V3 (generated) ไม่ใช่ "are" และต้องใช้ V3 ไม่ใช่ base form

Why should you never share API keys on a public GitHub repository?

ทำไมไม่ควรแชร์ API keys บน GitHub repository สาธารณะ?

Because API keys are deleted automatically.
Because API keys are too long to type.
Because public repositories are seen by everyone.
✅ Public repositories ถูกเห็นโดยทุกคน (are seen by everyone) ดังนั้นข้อมูลส่วนตัวเช่น API keys อาจถูกนำไปใช้ในทางที่ผิด

📊 คำสั่ง GitHub ที่ใช้บ่อย
Common GitHub Commands Reference

Command / คำสั่ง Description / คำอธิบาย Passive Voice Example
git init Create a new repository
สร้าง repository ใหม่
"A new repo is initialized."
git add . Stage all changes
เตรียมการเปลี่ยนแปลงทั้งหมด
"All files are added to staging."
git commit -m "msg" Save changes with a message
บันทึกการเปลี่ยนแปลงพร้อมข้อความ
"Changes are committed."
git push Upload to GitHub
อัปโหลดไปยัง GitHub
"Code is pushed to remote."
git pull Download from GitHub
ดาวน์โหลดจาก GitHub
"Updates are pulled from remote."
git branch Create/list branches
สร้าง/แสดง branch
"A new branch is created."
git merge Combine branches
รวม branch
"Branches are merged together."
git clone Copy a remote repository
คัดลอก repository จากระยะไกล
"The repo is cloned locally."

🎯 สรุป
Summary

🇹🇭 สิ่งที่คุณได้เรียนรู้

  • GitHub คืออะไรและ AI ช่วยเขียนโค้ดอย่างไร
  • คำศัพท์สำคัญ: repository, commit, push, pull, branch, merge
  • Passive Voice: be + V3 (is written, was created, has been fixed)
  • การสร้าง repository และใช้ AI เขียน README
  • การใช้ AI ตรวจสอบโค้ดบน GitHub

🇬🇧 What You Have Learned

  • What GitHub is and how AI assists coding
  • Key vocabulary: repository, commit, push, pull, branch, merge
  • Passive Voice: be + V3 (is written, was created, has been fixed)
  • How to create a repository and use AI to write a README
  • How to use AI for code review on GitHub

🎉 ยินดีด้วย! / Congratulations!

บทเรียน Week 5 ถูกเรียนจบแล้ว!

The Week 5 lesson has been completed! New vocabulary has been learned and passive voice has been practiced! 🐙