8 มิ.ย. เวลา 11:58 • การศึกษา
Github Desktop By Shoper Gamer

GitHub Desktop คืออะไร

โดย
GitHub Desktop เป็นแอปพลิเคชันที่ช่วยให้การใช้งาน Git และ GitHub ง่ายขึ้นด้วยอินเทอร์เฟซแบบกราฟิก (GUI) แทนการพิมพ์คำสั่งใน Command Line บทความนี้จะแนะนำวิธีใช้งาน GitHub Desktop สำหรับผู้เริ่มต้นตั้งแต่ติดตั้งจนถึงการทำงานพื้นฐาน
  • ​Github Desktop คืออะไร
GitHub Desktop คือ โปรแกรมช่วยจัดการ Repository บน GitHub แบบเห็นภาพช่วยให้
- ไม่ต้องจำคำสั่ง Git ยากๆ
- เห็นการเปลี่ยนแปลงของไฟล์แบบ Real-time
- ทำงานกับ Branch, Commit และ Push ได้ง่ายๆ ในคลิกเดียว
  • ​วิธีติดตั้ง Github Desktop
1. ดาวน์โหลดจาก desktop.github.com
2. ติดตั้งตามระบบปฏิบัติการ (Windows/macOS)
3. ล็อกอินด้วยบัญชี GitHub ของคุณ
  • ​เริ่มต้นใช้งาน Github Desktop
☆ 1. สร้าง Repository ใหม่
1. คลิก "File" → "New repository"
2. ตั้งชื่อ Repository (เช่น `my-first-project`)
3. เลือกตำแหน่งเก็บในเครื่อง (Local Path)
4. คลิก "Create repository"
☆ 2. Clone Repository ที่มีอยู่
1. คลิก "File" → "Clone repository"
2. เลือก Repository จากบัญชี GitHub ของคุณ
3. เลือกตำแหน่งเก็บในเครื่อง
4. คลิก "Clone"
  • ​การทำงานพื้นฐานของ Github Desktop
☆ การทำงานพื้นฐานกับ GitHub Desktop
☆ 1) สร้าง Commit
1. แก้ไขไฟล์ในโปรเจกต์ของคุณ
2. GitHub Desktop จะแสดงไฟล์ที่เปลี่ยนแปลง ในแถบ Changes
3. เขียนข้อความ Commit (ควรอธิบายให้ชัดเจน)
4. คลิกปุ่ม "Commit to main"
☆ 2.) สร้าง และ สลับ Branch
1. คลิกปุ่ม "Current branch" → "New branch"
2. ตั้งชื่อ Branch (เช่น `feature-login`)
3. คลิก "Create branch"
4. สามารถสลับ Branch ผ่านเมนูนี้ได้ตลอดเวลา
  • ​Push งานขึ้น Github
1. หลังทำ Commit ให้คลิกปุ่ม "Push origin"
2. โค้ดจะถูกอัปโหลดขึ้น Repository บน GitHub
  • ​ดึงโค้ดล่าสุด (Pull)
1. คลิกปุ่ม "Fetch origin"
2. หากมีโค้ดใหม่ จะเปลี่ยนเป็น "Pull origin"
3. คลิกเพื่อดึงโค้ดล่าสุดจาก GitHub
  • ​ฟีเจอร์เด่นของ Github Desktop
✅ ดูประวัติ Commit แบบกราฟิก
✅ แก้ไข Conflict ผ่าน Visual Editor
✅ สร้าง Pull Request ได้จากในแอป
✅ บูรณาการกับ Editor ยอดนิยม (VS Code, Atom)
✅ รองรับทั้ง GitHub และ GitHub Enterprise
  • ​ตัวอย่างการทำงานจริง
☆ กรณีศึกษา: เพิ่มฟีเจอร์ใหม่
1. สร้าง Branch ใหม่ชื่อ `feature-contact`
2. เพิ่มไฟล์ `contact.html` และแก้ไข
3. Commit ด้วยข้อความ "Add contact page"
4. Push ขึ้น GitHub
5. สร้าง Pull Request ผ่าน GitHub Desktop
  • ​ข้อดีของการใช้ Github Desktop
- เหมาะสำหรับผู้เริ่มต้น ที่ยังไม่คุ้นกับ Command Line
- ลดความผิดพลาด จากการพิมพ์คำสั่งผิด
- เห็นภาพการทำงานของ Git ชัดเจนขึ้น
- ทำงานร่วมกับทีมได้ง่ายแม้ไม่ใช่ Developer
✏️ Shoper Gamer
  • ​Github คืออะไร 👇
  • ​GUI คืออะไร 👇
  • ​CLI คืออะไร 👇
Credit :
👇
  • ​https://tinyurl.com/WhatIsGithubDesktop
  • ​https://docs.github.com/en/desktop/configuring-and-customizing-github-desktop/configuring-basic-settings-in-github-desktop
  • ​https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github
  • ​https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/authenticating-to-github-in-github-desktop
  • ​https://docs.github.com/en/desktop/overview/creating-your-first-repository-using-github-desktop
  • ​https://docs.github.com/en/desktop/adding-and-cloning-repositories/cloning-and-forking-repositories-from-github-desktop
  • ​https://docs.github.com/en/desktop/adding-and-cloning-repositories/adding-a-repository-from-your-local-computer-to-github-desktop
  • ​https://docs.github.com/en/desktop/making-changes-in-a-branch/managing-branches-in-github-desktop
  • ​https://docs.github.com/en/desktop/making-changes-in-a-branch/pushing-changes-to-github-from-github-desktop
  • ​https://docs.github.com/en/desktop/making-changes-in-a-branch/committing-and-reviewing-changes-to-your-project-in-github-desktop

ดูเพิ่มเติมในซีรีส์

โฆษณา