Setup Your Local Enviroment to Start Using Git

Git and the Command Line /
ความแตกต่างระหว่าง statuses and directories
ต้อง git install ก่อนเริ่ม
git ถูก install default โดย most mac and Linux
mac – มีตัวแทน terminal นิม iTerm2
– มี split panes
– autocomplete
– page search
ส่วน window สามารถใช้ได้ทั้ง cmd , git bash
git bash นิยมทั้งใน linux , window
ใน Linux มี default git อยู่แล้ว
mac มักจะมี git install อยู่แล้ว แม้จะ outdate version ก็ตาม
iMac git version 2.39.5 pc sleep room 2.70
plural 2.39.1
ถ้าเป็น hardcore user อาจจะ update
core basic มักจะไม่ปป
> type git เพื่อดูgit hashed อยู่ใน drive ไหน
จากนั้น เข้าไปใน local drive นั้น และ ต่อด้วย version
เพื่อดูแยกระหว่าง git ใน mac ที่ install มาแล้ว vs ที่พึ่ง update ใน local

mac – type git
what in window

In macOS, the command:

bash
type git

shows how the git command is resolved (e.g., built-in, alias, or executable path). Example output:

python
git is /usr/bin/git

Windows Equivalent

In Windows Command Prompt (CMD):

cmd
where git

This shows the full path(s) to the git.exe binary. Example:

makefileCopyEditC:\Program Files\Git\cmd\git.exe

In PowerShell:

powershell
Get-Command git

This provides detailed info about the command, including its source:

pgsqlCopyEditCommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     git.exe                                            2.39.1.1   C:\Program Files\Git\cmd\git.exe

Let me know if you’re using Git Bash or WSL — those behave more like macOS/Linux shells.

sheel command -for navigating file ใน command prompt – จำว่าอันนี้ไม่ใช่ git command , แต่เป็น shell command
pwd – print working directory
mkdir – make directory
Ls – list contents of a directory
cd – change directory
touch – create a new file in the current

Installing Git

Create a New Git Repository

Settting Git Configurations