How to Learn Git: เรียนรู้ Git อย่างไร?
ในเส้นทางสู่การเป็น Programmer คุณน่าจะเคยได้ยินคำว่า Git มาบ้าง แต่ Git คืออะไร และทำงานอย่างไร?
คำถามนี้คู่มือนี้จะตอบให้
Git เป็นเครื่องมือสำคัญที่ Developer ทั่วโลกใช้จัดการโค้ดและร่วมงานโปรเจกต์ร่วมกัน ในคู่มือนี้ เราจะแยก Basics ของ Git และ武装您以开始使用 Git Version Control System จบคู่มือคุณจะรู้ Basics ของ Git และอธิบายความสำคัญของ Git Version Control ได้
What Is Git? Git คืออะไร?
Git ออกแบบโดย Linus Torvalds ในปี 2005 เป็น VCS ที่ใช้มากที่สุดในโลก Git เป็น Distributed VCS หมายความว่าทุก Developer ที่มี Copy ของโค้ด จะเก็บ History ของการเปลี่ยนแปลงที่ทำไปที่ Repository ด้วย นอกจากนี้ Git ฟรีและ Open-source โค้ดของ Git เปิดเผยสาธารณะ
นี่หมายความว่าอะไร? เมื่อ Developer Copy Git Repository—ซึ่งใช้เก็บโค้ดด้วย Git Protocol—พวกเขาจะ Copy รายการการเปลี่ยนแปลงและ Record ใครทำการเปลี่ยนแปลงเหล่านั้นมาด้วย ดังนั้นไม่จำเป็นต้องมี Single Centralized Source ที่ Track การเปลี่ยนแปลงของ Repository เหมือน Tools เช่น Subversion หรือ CVS
What Is a Version Control System? Version Control System คืออะไร?
Git เป็นประเภทหนึ่งของ Version Control System ที่ใช้ Maintain Code
เพื่อเข้าใจว่าทำไม Git มีประโยชน์ เราต้องเข้าใจ Purpose ของ Version Control System ก่อน ใน Technology Version Control Systems คือ Software Tools ที่ใช้ Track การเปลี่ยนแปลงของ Code ตามเวลา
Version Control Systems (VCS) เก็บ List ของการเปลี่ยนแปลงทั้งหมดที่ทำไปที่ Code ใน Database พร้อมกับ ใครทำการเปลี่ยนแปลง และ Description ของการเปลี่ยนแปลง ในเกือบทุกโปรเจกต์—ใหญ่และเล็ก—Version Control เล่นบทบาท
สำหรับ Teams การมี VCS ที่แข็งแกร่งเป็นสิ่งสำคัญมาก มีหลายเหตุผล แรก VCS ให้ Team Track การเปลี่ยนแปลงตามเวลา หากมีอะไรผิดพลาด พวกเขาจะมี Record ของการเปลี่ยนแปลงและ Events นำไปสู่ปัญหาที่ Team เผชิญ
สอง VCS ให้ Team เก็บ Versions ต่างๆ ของโปรเจกต์ ดังนั้นทันทีที่ Release ใหม่พร้อม สามารถเก็บใน Version Control Platform พร้อม Name, Description ของ Release และ Metadata อื่นๆ (เช่น Author Name, ฯลฯ)
แม้ Individual Developers ก็ใช้ประโยชน์จาก VCS ได้ เพราะ Primary Function ของ Version Control คือ Track Code และแม้ทำงานคนเดียว คุณก็ยังต้องการ Record ของ Code และวิธีที่มัน Evolve
What is Git Used For? Git ใช้ทำอะไร?
Git ใช้ Track การเปลี่ยนแปลงที่ทำไปที่ Codebase ให้ Developer เห็นว่า Codebase เปลี่ยนแปลงอย่างไรตามเวลา ทุกครั้งที่ File ถูก Commit เข้า Repository Record จะเก็บ ใครเปลี่ยนไฟล์นั้น เมื่อเปลี่ยน และการเปลี่ยนแปลงอะไรที่ทำไปที่ไฟล์
Features สำคัญที่สุดของ Git Version Control System:
- File Tracking – ทุกการเปลี่ยนแปลงที่ทำไปที่ Code ใน VCS ถูก Track รวมถึง Amendments, Deletions, Edits, File Movements, และข้อมูลอื่นๆ
- History Tracing – การเปลี่ยนแปลงของ Repository ควร Track และ Analyze ได้ง่าย Version Control ให้ Developer เห็นไม่แค่อะไรเปลี่ยน แต่เมื่อไหร่ และใครทำการเปลี่ยนแปลง
- Branching – Branching ให้ Developer สร้าง Copy ของ Codebase ที่ Independent จาก Main Project Developer ทำการเปลี่ยนแปลงที่ Branch แล้ว Merge กับ Main Project เมื่อพร้อม
ทั้ง Individual Developers และ Professional Teams ใช้ Git Track Code
Individual Developers ใช้ Git เก็บว่า Code ของพวกเขา Evolve อย่างไร เพราะ Git เก็บ Record ของ Project History Individuals สามารถพึ่งพาได้หากต้องดึง Past Version ของโปรเจกต์
Professional Teams มักใช้ Git มากกว่า เพราะมักมีโปรเจกต์ใหญ่กว่าที่ต้อง Track Team อาจมี Multiple Branches โค้ดหลาย Developer โปรเจกต์ Git เดียวกัน
Learning Git: การเรียนรู้ Git
Git เป็น Essential Skill สำหรับ Software Developer ใดๆ สำหรับ Personal Use คุณใช้ Git Track การเปลี่ยนแปลงโค้ด คุณยังใช้ Git กับ Tools เช่น GitHub หรือ Bitbucket เพื่อโชว์โค้ดให้โลกเห็น
ใน Professional Development Environment ที่ใช้ Git คุณคาดหวังใช้ Git ทุกวัน ก่อนเริ่ม Career เป็น Developer คุณควรรู้ Basics ของ Git เช่น สร้าง Repository, Push Code, และทำงานกับ Branches
Git เป็น Command Line Interface มี Browser Tools เช่น GitHub ให้ควบคุมโค้ดด้วย Git แต่งานส่วนใหญ่ยังทำใน Command Line
How Long Does it Take to Learn Git? ใช้เวลานานแค่ไหน?
จะใช้เวลาไม่กี่ชั่วโมงเรียน Basic Git Commands นี่คือ Commands ที่ให้สร้าง Repository, Push Code ไป Repository, และ Retrieve Code คาดว่าจะใช้เวลาอย่างน้อย 1 เดือนเรียน Advanced Commands
Git มี Shallow Learning Curve ดังนั้นเริ่มได้เร็ว ไม่ต้องมี Software Engineering Knowledge มาก แม้ Experience Coding มากกว่า จะง่ายขึ้นในการเรียน Basic Principles ของ Git
Git เป็น Skill ที่ Professional Software Developers ปรับปรุงในวันทำงาน เพราะ Scenario หลากหลายที่เข้ากับ Git
ก่อนเข้า Professional Software Job ควรมี Experience ใช้ Git อย่างน้อย 1 เดือน นี่คือเวลาที่ดีสำหรับเรียน Advanced Commands ที่อาจขึ้นใน Professional Environment
How to Learn Git: Step-by-Step
Git เป็น Skill ที่มีประโยชน์สำหรับ Software Engineer ใดๆ Software Engineering Teams ส่วนใหญ่ใช้ VCS Track Code และ Percentage ใหญ่ใช้ Git
Steps ที่ควรทำเพื่อเรียน Git:
- คุ้นเคยกับ Programming Language คุณต้องมี Code ที่ Track ใน Git Repository ก่อนเรียน Git ควรคุ้นเคยกับอย่างน้อย 1 Programming Language
- Install Git ติดตั้ง Git Command Line บนคอมพิวเตอร์ ต้องการ Git Command Line เพื่อรู้จริงว่า Git ทำงานอย่างไร
- เรียน Basic Commands ใช้เวลาบضعชั่วโมงเรียน Push Code ไปและ Retrieve Code จาก Repository Practice Clone Repository และสร้างจาก Scratch
- Sign up GitHub แม้ไม่จำเป็นสำหรับเรียน Git แต GitHub ทำให้ Host Repositories ที่ใช้ Git ง่าย คุณใช้ GitHub Share Code ให้โลกเห็น หรือ Backup Local Repository
- Advance Knowledge เมื่อเรียน Basics เรียบร้อย ควร Advance Knowledge โดยทดลอง ลอง Track Code ข้าม Branches Research Features เช่น Reset Repository ไป Past Commit
การเดินทางเรียน Git ของคุณจะไม่มีวันจบ จะมี Command หรือ Skill ใหม่ให้คุณเรียนตลอดเวลา นี่เกิดกับหลาย Programming Technologies แต่นี่คือสิ่งที่ทำให้ Coding น่าตื่นเต้น
The Best Git Courses and Trainings: หลักสูตรและฝึกอบรม Git ที่ดีที่สุด
โชคดีที่มีหลักสูตรออนไลน์เยอะมากสอน Git Version Control System เพื่อช่วยเริ่มต้น เรารวบรวม Top Courses ที่ครอบคลุม Git
Online Git Courses
Git Going Fast: One Hour Git Crash Course
- Provider: Udemy
- Cost: $20.00
- Audience: Beginner
หลักสูตรนี้มุ่งสอน Basics ของ Git ใน 1 ชั่วโมง มี 10 Articles, 4 Downloadable Resources, และ 1 ชั่วโมง Interactive Lectures
ในหลักสูตร คุณเริ่มเรียน Git Workflow แล้วเรียน Setup Git Repository, Merge Files, Remove Files, Ignore Files ต่อมา Crver Git Remotes
Version Control with Git
- Provider: Udacity
- Cost: Free
- Audience: Beginner
Version Control with Git เป็น Basic Introduction to Git Command Line ใช้เวลาประมาณ 4 สัปดาห์ มี Interactive Quizzes และ Lectures จาก Experts
ในหลักสูตร คุณจะไปจากสร้าง Git Repository ของตัวเอง จนถึง Organize Commits ด้วย Tags และ Branches จะเรียน Undo Changes ใน Git Repository ด้วย
Learn Git
- Provider: Codecademy
- Cost: Pro membership ($16 / month)
- Audience: Beginner
หลักสูตรนี้ช่วย Build Basic Understanding ของ Git เริ่มเรียน Git ทำงานอย่างไร และทำไมใช้ ต่อมาเรียน Undo Changes และ Manage Code ข้าม Branches
ใน Module สุดท้าย คุณจะเรียน Git ใช้ใน Collaborative Environments Module นี้ครอบคลุม Remote Repositories, Pulling Code, และ Pushing Code
Git Tutorials
Interactive Tutorials เป็นวิธีที่ราคาไม่แพงสำหรับ Advance Skillset เรารวบรวม Best Git Tutorials สำหรับ Beginners, Advanced, และ Free Tutorials ดูเพิ่มเติมด้านล่าง
Best Git Tutorials for Beginners
Learn Git with BitBucket Cloud
Tutorial นี้เป็น Option ยอดเยี่ยมสำหรับ Complete Novice จะช่วย Master Version Control Software Open-source ยอดนิยมจากศูนย์ จบ Tutorial คุณจะมี In-depth Knowledge ของ History of Git, Branching, Benefits of Version Control, และ Traceability
Tutorial เริ่มจาก Setup Git Repository แล้วพาไป Interactive Lessons หลายๆ เรื่องเรียนรู้ Git ออกแบบให้เข้าใจง่ายสำหรับ Learners ทุกระดับ
An Intro to Git and GitHub for Beginners
หากมองหา Step-by-step Guide ใช้ Git HubSpot มอบ Tutorial ระดับ Beginner จะสอน Install และสร้าง Github Account จากศูนย์ Tutorial มี Basic และ Advanced Steps ทั้งหมดเพื่อ Add Content และ Diversify Environment
ในแค่ 9 Steps คุณเรียนสร้าง Git Central Repository Account Tutorial เดินทางผ่าน Process เพิ่ม File ใหม่, สร้าง Git Environment, สร้าง Commit, และสร้าง Branch คุณยังเรียนสร้างและ Merge Pull Request
Git Immersion
หากคุณ Complete Beginner Git Immersion Tutorial ช่วยเรียน Git ทำงานอย่างไรใน Workplace Setup Tutorial ให้โอกาส First-hand Experience ใช้ Git ตั้งแต่ Installation จน Manage Repositories Tutorial นี้ Introduce Students to Open-source Management องค์ประกอบใหม่ของ Git Control
สำหรับ Tutorial นี้ ต้องการ Ruby Interpreter ที่ทำงาน หากต้องการ จะช่วย Setup ให้ Hands-on Approach ของ Git Immersion ให้คุณ Master Fundamentals ของ Git Main Features เมื่อจบ
Easy Version Control with Git
สร้าง Features หรือ Updates ใหม่สำหรับโปรเจกต์อาจ Challenging มาก โดยเฉพาะเมื่อ Developer มากกว่า 1 คน מעורב นี่คือเหตุผล Platforms เช่น Git มีอยู่ ใน Tutorial นี้ คุณจะเรียน Basics of Git, Uses, และ Setup
Envato Tuts+ Curated Tutorial นี้ช่วย Students ผ่าน Configuration of Git จะครอบคลุม Run Git Command จากต้นจนจบ หมายความว่าคุณจะเรียน Git init, add commit, status, และ branch ใน Visual Presentation
Git Complete: The definitive, Step-By-Step Guide to Git
Udemy Tutorial นี้สอน Vital Concepts ของ Git จากศูนย์ หลัง Course 6 ชั่วโมง คุณจะมีสิ่งที่ต้องการนำ Git Skills ไป Level ถัดไป คุณจะเป็น Pro ใน Managing, Renaming, Deleting, และ Updating Files ด้วย Git
ราคา $139.99 คุณได้ First-hand Experience ท้าทาย Fundamentals Platform ให้คุณรู้ Ins and Outs ของ Git Commands, Rebasing, Stashing, และ Comparisons เมื่อ Master ทุกอย่าง คุณจะได้ Professional Certificate of Completion และ Full-time Access Course Resources
Best Advanced Git Tutorials
Advanced Git Tutorial
Tutorial ยอดเยี่ยมจาก MUO ช่วย Advance Skills ใน Version Control จาก Fix Bugs และ File Deletion จน Code Deployment Tutorial นี้ให้ Well-rounded Vision ของ Git Capabilities
Tutorial นี้จะแสดง Push Changes จาก Local Branch ไป Replica และ Pull Requests และ Merge Replica Branch นี่สำคัญมากเมื่อต้องการ Developer อื่น Review Changes ก่อน Make Live จะ Walk You Through Git Rebase, Squash, Fork, File Restoration, Git Reset, Revert, และ Logging
How to Resolve Merge Conflicts in Git
GitKraken ออกแบบ Tutorial นี้สอน Resolve Merge Conflicts ใน Git Conflicts เกิดขึ้นเมื่อพยายาม Rebase หรือ Merge Git Branch เมื่อ Git ไม่สามารถ Combine 2 Commits ได้สำเร็จ คุณต้อง Establish Changes ที่ทำบน Same Line of Code หรือ Files
Tutorial จะช่วย Identify เมื่อ Conflict เกิดขึ้นและ Resolve ยังไง เรียน Check Conflicts ใน File และ View Output สำหรับ Correction เมื่อ Resolve Conflicts ทั้งหมด สามารถ Proceed Merge ได้สำเร็จ
Advanced Git Tutorial
Slideshare มี Tutorial นี้สอน Gain Ultimate Control over Git Advanced Tutorial นี้จะแสดง Create Changes ก่อน Deep Dive Advanced Git Commands คุณจะเรียน Manage Advanced Applications
หากอยาก Master Debugging, Rewriting Repositories, และ Untangling Commits นี่คือ Tutorial ที่สมบูรณ์ จะ Advance Git Skills โดยไม่มีค่าใช้จ่ายและใน Short Period
Advanced Git Commands And GitHub Integration Tutorial
Software Testing Help มอบ Tutorial ให้ Professionals เรียน Advanced Git Commands Tutorial นี้ช่วย Master Git Cherry Pick, Git Stash, และ Git Reset คุณจะผ่าน Git Bisect และเรียน Integration กับ Jira
Integration Process สำคัญสำหรับ Pull Requests และ Creating Branches Developer ใช้ Jira Merge Replica Branch กับ Main Branch สำเร็จ เพื่อทำนี้ คุณจะเรียน Change Status ของ Jira Issue จบ Tutorial คุณจะมี Better Grasp ของ Advanced Git Commands ทั้งหมด
Merging vs. Rebasing
อยาก Master Merging และ Rebasing? Bitbucket มอบ Step-by-step Tutorial สอน Differences ระหว่าง Git Merging และ Git Rebasing และ Benefits ของแต่ละอย่าง ให้ Clear Overview ของ Git Merging และแสดงว่า Non-destructive Operation คุณจะเรียนทำไม Git Rebasing เป็น Alternative ยอดเยี่ยมสำหรับ Merging
Tutorial จะสอน Interactive Rebasing นี้ให้คุณ Alter Commits เมื่อ Move ไป Branch ใหม่ Great Alternative to Automotive Rebasing เพราะคุณจะมี Better Overlook ของ Branch History Tutorial จะ Touch Basic Workflows และ Integrate New Feature
Best Free Git Tutorials
Practical Git for Everyday Professional Use
Tutorial นี้บน egghead.io พาคุณผ่าน Practical Use of Git ในไม่กี่ 1 ชั่วโมง ครอบคลุม Fundamentals และ Advanced Concepts เป็น Practical Training Course สอน Create Local และ Remote Repositories, Capture Previous Code คุณจะเรียน Document, Sync, และ Isolate Features ด้วย Git
เพิ่มเติม Tutorial แสดง Capture Commit History และ Format History ด้วย Git Arguments คุณจะเรียน Filter History และ Compare Changes ใน Files ด้วย Git จบ Tutorial คุณควร Run Scripts, Remove Unwanted Git Tracking, และ Diagnose Git Bugs
Git Tutorial for Beginners – Crash Course
Academic Mind มอบ Tutorial สำหรับ Beginners เรียน Basics ของ Git คุณจะได้เรียน Functionality ของ Repositories, Branches, และใช้ Main Commands บางอย่าง
จบ Tutorial คุณจะ Solve Merge Conflicts ที่เกิดจาก Merging Branches Tutorial ยัง Illustrate Beginners Install Version Control System และครอบคลุม Difference ระหว่าง Git และ GitHub
Mastering Git
Vimeo มี Free High-end Tutorial ช่วย Professionals Master Git Tutorial 1 ชั่วโมงนี้มี Aspects ทั้งหมดของ Version Control System รวม Commands และ Functionalities ต่างๆ
เพราะเป็น Hands-on Tutorial คุณจะครอบคลุม Installation Process of Git และเรียนสร้าง Local Repositories คุณยังเรียน Add Files และ Make Commits, View Commits History Instructor ยัง Touch Sharing Repositories และ Merging Changes ที่ Developers ทำ
Git Tutorial
Tutorials Point มอบ Tutorial ช่วย Beginners Master Basic Functionality of Git คุณจะเรียน Git Leveraged ระหว่าง Application Development ใน Distributed Environment และเรียน Git Lifecycle
เพื่อให้เข้าใจ Concepts ง่ายขึ้น ควรมี Knowledge และ Experience ใน Software Development Life Cycle ควรมี Background Knowledge ใน Web Application Development
Learn Git Branching
Learn Git Branching มี Multiple Online Training Courses ครอบคลุม Aspects ต่างๆ ของ Git ไม่ว่าคุณ Beginner หรือ Expert คุณได้ประโยชน์จาก Tutorials เรียน Ins and Outs ของ Git Beginners ไป Step-by-step Guide Git Commits, Branching in Git, Merging, และ Rebasing จะช่วยคุ้นเคย Common Git Commands
หากอยาก Ramp Up Skills เลือก Intermediate Tutorials จะพา Fundamental Concepts รวม Detaching, Relative References, และ Change Reversal in Git จบแล้ว Move Forward to Interactive Rebase และ Cherry Pick ยังเรียน Branch Spaghetti, Juggling Commits, Git Describe, และ Git Tags
Online Git Books
Pro Git by Scott Chacon and Ben Staub
Pro Git เป็น Detailed Tutorial ใช้ Git เริ่มเรียน Basics แล้วครอบคลุม Topics เช่น Branching, Git on Server, และ Distributed Workflows
Book นี้ Excellent สำหรับทุก Audience จาก Beginners ถึง Experts หากคุณ New to Git ควรเริ่มต้นหนังสือเล่มนี้และผ่าน Tutorials เมื่อเรียน Basics เรียบร้อย ใช้ Book นี้เป็น Reference Guide ช่วยคุณต่อไป
Version Control with Git by Jon Loeliger and Matthew McCullough
Version Control with Git ช่วยเริ่มต้น Git เรียน Common Scenarios ที่ Git ใช้ Book นี้ครอบคลุม In-depth Basic Commands ที่ต้องรู้ใช้ Git
ภายหลังใน Book จะเรียน Topics เช่น Merges, Conflicts, และ Diffs Knowledge นี้จะ Set You In Good Stead เมื่อเริ่มใช้ Git Advanced Use Cases
Git Pocket Guide: A Working Introduction by Richard Silverman
มี Reference Guide Git เป็นประโยชน์เพราะมี Commands หลากหลายที่ใช้ได้ Book นี้เขียนให้ Stay With You ขณะ Advance Knowledge ของ Git
ใน Book นี้ คุณจะพบ Handy Primers บน Topics เช่น Merging Branches, Cloning Repositories, และ Examining Changes to Repository
Online Git Resources
GitHub Git Handbook
ใน Handbook นี้ คุณจะครอบคลุม Basics ใช้ Git Command Line เริ่มเรียน Role of Version Control Systems ใน Software Project แล้ว Pick Up Basic Commands
Handbook นี้เป็น Great Introduction to Git สำหรับ Anyone ไม่มี Prior Knowledge Version Control คุณจะเรียน Apply Git Skills ไป Platform GitHub ด้วย
GitHub Git Cheat Sheet
Cheat Sheet นี้เป็นที่ดีหากลืม Command ที่ต้องการใช้ จะพบ List โหลด Commands ครอบคลุม Inspecting Repository ถึง Ignoring Files
Cheat Sheet ให้ One-line Explanation พร้อมแต่ละ Command และ Detailed Headings ทำให้ Navigate Sheet หา Command ที่ต้องการง่าย
Career Karma Git Tutorials
Career Karma เขียน Tutorials เกี่ยวกับ Git Commands หลายอย่าง ใน Library ของเรา จะพบ Tutorials ครอบคลุม git merge, git checkout, git init, และ Commands อื่นๆ
Should You Study Git? ควรเรียน Git หรือไม่?
มีหลายเหตุผลที่ Developers ใช้ Git VCS แทน Platforms อื่นๆ แม้ทุก Team มี Version Control Needs ตัวเอง Git ครอบคลุม Most Key Features ที่ Developers ต้องการใน VCS Maintain Code
มาอภิปรายเหตุผลบ้างที่ Developer หรือ Dev Team อาจเลือก Git แทน Others
Git Is Powerful and Secure: Git อันทรงพลังและปลอดภัย
Git VCS ออกแบบด้วย Performance ในใจ หมายความว่า Committing, Merging, และ Tracking Changes ทำได้ Efficiently, Effectively, และ Syntax ที่ง่ายสำหรับ New Developers Pick Up Git Focus บน Contents of Files ซึ่งให้ VCS Offer Performance Benefits ให้ Users
เพิ่มเติม Security เป็น Core Pillar ของ Git Objects ทั้งหมดใน Git Repository Secured ด้วย Hashing Algorithm SHA1 และ Git ใช้ Approaches หลายอย่างให้แน่ใจว่า Code ใน Repository Kept Secure และ Cannot Be Manipulated
Git Is Widely Used: Git ใช้แพร่หลาย
เพราะ Git widespread วันนี้ มักเป็น VCS แรกที่ New Developers Discover เพิ่มเติม เพราะคนเยอะรู้ Git มี Wide Range of Resources ช่วย New Developers เรียนรู้ใช้ VCS นี่รวมกับ Performance Benefits ของ Git ทำให้มัน Good Skill สำหรับ Developer ใดๆ
Git Is Collaborative: Git ร่วมงานได้
Git VCS เป็น Collaborative Technology ด้วย Tools เช่น Git Developers ร่วมงานโปรเจกต์ได้ตลอดเวลาข้าม Time Zones ยังคง Efficiently Store และ Access Code
เพิ่มเติม Git มี Collaborative Features เช่น Branching ให้ Multiple Developers ทำงานส่วนต่างๆ ของโปรเจกต์โดยไม่รบกวนกัน จนกว่าจะ Finish Making Change to Code
นี่แค่ 3 เหตุผลจากหลายๆ เหตุผลที่ Developers มากมาย Prefer Git แทน VCS อื่น
Git Jargon to Know: คำศัพท์ Git ที่ควรรู้
เมื่อเริ่มได้ยิน Git มากขึ้น มี Jargon Terms ที่คุณจะได้ยิน 3 อันที่ Common ที่สุดคือ Repositories, Commits, และ Pushing มาแยกแต่ละอย่างให้คุณรู้ว่า Developers พูดอะไรเมื่อคำเหล่านี้ใช้:
- Repository คือคำที่ Git ใช้แทน Project Repository หรือ Repo เก็บ Files และ Folders ทั้งหมดของโปรเจกต์ พร้อม Record ว่า Files/Folders Evolve อย่างไรตามเวลา ด้วย Git คุณ View Current State และ History ของ Repository ได้
- Commit คือ Saved Change ที่ทำไปที่ Repository ทุกครั้งที่ทำการเปลี่ยนแปลงโค้ด ควร Commit เข้า Git Repository นี่เพิ่ม Record ของการเปลี่ยนแปลงที่คุณทำเข้า Changelog ของ Repository ซึ่งคุณอ้างอิงย้อนหลังได้ในอนาคต
- Pushing หมายถึง Upload Code จาก Local Repository (เก็บบนคอมพิวเตอร์) ไป Remote Repository ที่เก็บบน Machine อื่น
Remote Repositories
เหมือนที่อภิปรายก่อนหน้า 1 Crucial Component ของ Git VCS คือ Distributed เมื่อ Store Code ใน Git Repository คุณใช้ Repository เป็น Centrally-located Place ที่ Code ถูกเก็บ แล้ว Developers อื่น Copy Code จาก Repository ของคุณและ Push Changes ไปตลอดเวลา
ตอนทำงานกับ Git Term Remote ใช้ Describe Central Repository of Code นี่คือ Project ที่หลายคน Access ได้ แล้วเมื่อมี Remote Repository Setup คุณ Push Code ไป Repository และให้ Others ทำเหมือนกัน
Platforms เช่น GitHub, BitBucket, และ GitLab ทั้งหมดใช้ Store Code Remotely หรือใน Advanced Scenarios Developers Setup Git Server เอง
หากทำงานโปรเจกต์คนเดียว ไม่ต้องมี Remote Repository เพราะใช้ Git บนคอมพิวเตอร์ Track การเปลี่ยนแปลง Code ตามเวลาได้เอง
Conclusion
Git เป็น Version Control System ที่ Developer ล้านๆ คนทั่วโลกใช้ Store และ Track Code ของพวกเขา
Git มอบ Features เช่น History Tracing และ File Tracking ทำให้ง่ายดูว่า Project Evolve อย่างไรตามเวลา เพิ่มเติม เพราะ Git Distributed Technology นี้ใช้ง่ายโดย Teams ร่วมงานโปรเจกต์ใหญ่ร่วมกัน
คู่มือนี้อภิปราย Basics ของ Git Version Control System ทำไม Developers ใช้ Git และสำรวจ Jargon Terms ที่อาจได้ยินตอนเริ่มเรียน Git ตอนนี้คุณพร้อมเริ่ม Journey เรียน Git แล้ว