ตัวอย่างบทเรียน

Installation and Setup: Getting Git Ready for First Use

Install Git on Windows, macOS, and Linux, and explore why configuring your name and email isn't just a formality but an integral part of commit history. Set up a user-friendly terminal and several useful aliases to work comfortably from day one, rather than struggling with lengthy commands.

Git installation git config global configuration
คุณจะเรียนรู้อะไรในบทเรียนนี้
  • You will be able to install Git on any operating system and verify the installation was successful.
  • You will understand why Git requires a name and email, and how this information appears in commit history.
  • You will be able to configure global settings in a way that won't require future adjustments.

จุดเริ่มต้นของบทเรียน

Why Git Bash is the Best Choice for Windows

  • Git Bash provides a full Unix environment for Windows
  • Solves line ending differences between Windows and Unix systems
  • Ensures command consistency with Linux/Mac
  • Prevents collaboration errors

If you're working on Windows, the standard command prompt can cause unexpected issues when using Git, particularly with line ending characters and file paths. Git Bash solves these problems by providing a complete Unix environment right in Windows. This means all commands will work the same as they do for your colleagues on Linux or Mac. You'll avoid numerous collaboration errors and save hours of debugging time. This is especially important for new developers who are just learning version control systems.

Step by Step: Downloading and Installing Git

  • Open git-scm.com in your browser
  • Download the latest version of Git for Windows
  • Run the installer as administrator
  • Accept the license agreement

Open your browser and navigate to the official website git-scm.com. On the homepage, you'll immediately see a prominent download button that automatically detects your operating system. Download the installer and run it as administrator. The first screen will present you with the license agreement—scroll through and click 'Next'. I recommend keeping all default settings unless you're confident about making changes.

Critical Git Installation Settings

  • Select 'Use Git from Windows Command Prompt'
  • Set 'Checkout as-is, commit Unix-style'
  • Keep Nano as the default editor for beginners
  • These settings are crucial for compatibility

One of the key moments during installation is selecting the right options. When configuring PATH, choose 'Use Git from the Windows Command Prompt'. This will allow you to run Git from any command line. Next, for line ending conversion, select 'Checkout as-is, commit Unix-style line endings' — this ensures compatibility with other systems. Keep Nano as the default editor if you're not familiar with alternatives — it's simpler for beginners. These settings are absolutely crucial for Git to function correctly in the future.

บทเรียนฉบับเต็มใช้ได้เมื่อสมัครสมาชิก

ฉบับเต็มมีสไลด์เพิ่มอีก 29 สไลด์

วิดีโอ สไลด์ทั้งหมด โน้ต แบบทดสอบ AI ติวเตอร์ และการสัมภาษณ์จะเปิดหลังเข้าสู่ระบบและสมัครสมาชิก

เข้าสู่ระบบหรือลงทะเบียน สมัครสมาชิก

เนื้อหาบทเรียน

  1. Why Git Bash is the Best Choice for Windows
  2. Step by Step: Downloading and Installing Git
  3. Critical Git Installation Settings
  4. Verifying Git Installation
  5. Installing Git on macOS: The Easy Way with Homebrew
  6. Installing Git on Linux: Commands for Different Distributions
  7. How to Verify Git is Installed Correctly
  8. Your Digital Signature in Git
  9. Setting Up Your Name and Email for Commits
  10. Consequences of Incorrect Author Configuration
  11. Git Global Settings: Your Digital Fingerprint
  12. Practice: Configuring Developer Name and Email
  13. Verifying Git Configuration
  14. Three Levels of Git Configuration: System, Global, Local
  15. System Settings: General Rules for All
  16. Global Settings: Your Personal Profile
  17. Local Settings: Project-Specific Rules
  18. Why Does Git Need a Text Editor?
  19. Setting Up Your Preferred Editor for Git
  20. Example Commands for Popular Editors
  21. Git Aliases: Your Personal Command Dictionary
  22. Creating Your First Alias: git status
  23. Alias for Beautiful History Visualisation
  24. How to View All Created Aliases
  25. Colour Output in Git: More Than Just Pretty Colours
  26. Enabling Colour Output in Git
  27. Customising Colours to Your Preferences
  28. Common Author Configuration Mistakes
  29. Global vs Local Settings: Which Takes Precedence?
  30. Editor Won't Launch? Troubleshooting Guide
  31. 30-Second Settings Verification
  32. Your Git is Ready to Go!

บทความเกี่ยวกับบทเรียนนี้

บทเรียนทั้งหมดในคอร์สนี้

  1. Introduction: Git from Scratch to Confident Developer
  2. Why Git is Essential - And Why It's a Job Requirement
  3. Installation and Setup: Getting Git Ready for First Use
  4. First Repository: init, add, commit, and the Magic of the Index
  5. Reading History: log, diff, show and Navigating the Past
  6. Branches: The Parallel Reality of Your Code
  7. Undoing Mistakes: restore, reset, revert — Doing It Right and the Dangers
  8. GitHub and Remote Repositories: Your Code in the Cloud
  9. Team Collaboration: Forks, Feature Branches, and Pull Requests
  10. Merge Conflicts: Don't Panic - Understanding and Resolving Them
  11. Git Workflows in Real Teams: Choosing the Right Approach
  12. Advanced Tools: Rebase, Stash, Cherry-pick and Tags
  13. Final Project: Simulating Real Team Development