็ฌฌ 1 ๆญฅ๏ผๆๅผไธ่ฝฝ้กต้ข
- ๆๅผๆต่งๅจ่ฎฟ้ฎ https://git-scm.com/download/win
- ้กต้ขไผ่ชๅจๆฃๆตไฝ ็็ณป็ปๅนถๅผๅงไธ่ฝฝ
- ๅฆๆๆฒกๆ่ชๅจไธ่ฝฝ๏ผ็นๅป Click here to download manually
็ฌฌ 2 ๆญฅ๏ผ่ฟ่กๅฎ่ฃ ็จๅบ
- ๆพๅฐไธ่ฝฝ็ๆไปถ๏ผ้ๅธธๅจ"ไธ่ฝฝ"ๆไปถๅคน๏ผ
- ๅๅป่ฟ่ก
Git-xxx-xxx-bit.exe
็ฌฌ 3 ๆญฅ๏ผๅฎ่ฃ ๅๅฏผ
ๆ็ งไปฅไธๆญฅ้ชค็นๅป๏ผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Git Setup โ
โ โ
โ Welcome to Git Setup โ
โ โ
โ [Next >] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GNU General Public License โ
โ โ
โ [้
่ฏป่ฎธๅฏๅ่ฎฎ] โ
โ โ
โ [Next >] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Select Components โ
โ โ
โ โ Git Bash โ ๅฝไปค่กๅทฅๅ
ท๏ผๅฟ
้กป้ โ
โ โ Git GUI โ ๅพๅฝข็้ขๅทฅๅ
ท โ
โ โ Git LFS โ ๅคงๆไปถๆฏๆ โ
โ โ Associate .git โ ๅ
ณ่ .git ๆไปถ โ
โ โ Add Git Bash to โ ๆทปๅ ๅฐ็ป็ซฏ โ
โ Terminal Explorer โ
โ โ
โ [Next >] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ๅ ณ้ฎ่ฎพ็ฝฎ้กต้ข๏ผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Adjusting your PATH environment โ
โ โ
โ โ Use Git from the Windows Command Prompt โ
โ โ Use Git from the Windows Command Prompt โ
โ and optional Unix tools from the Prompt โ
โ โ ๆจ่้ๆฉ่ฟไธช โ
โ โ Use Git and optional Unix tools from the โ
โ Windows Command Prompt โ
โ โ
โ [Next >] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Choosing the SSH executable โ
โ โ
โ โ Use bundled OpenSSH โ ๆจ่ โ
โ โ Use external OpenSSH โ
โ โ
โ [Next >] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Configuring line ending conversions โ
โ โ
โ โ Checkout Windows-style, commit โ
โ Unix-style line endings โ ๆจ่ Windows โ
โ โ Checkout as-is, commit Unix-style โ
โ โ Checkout as-is, commit as-is โ
โ โ
โ [Next >] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
็ฌฌ 4 ๆญฅ๏ผๅฎๆๅฎ่ฃ
- ็นๅป Install ๅผๅงๅฎ่ฃ
- ็ญๅพ ๅฎ่ฃ ๅฎๆ
- ็นๅป Finish
- ๆ
Win + Rๆๅผ่ฟ่ก็ชๅฃ - ่พๅ
ฅ
cmdๅนถๅ่ฝฆ - ่พๅ ฅไปฅไธๅฝไปคๅนถๅ่ฝฆ๏ผ
winget install Git.Git็ฌฌ 1 ๆญฅ๏ผๆๅผ็ป็ซฏ
- ๆ
Command + ็ฉบๆ ผๆๅผ Spotlight - ่พๅ
ฅ
Terminalๅนถๅ่ฝฆ
็ฌฌ 2 ๆญฅ๏ผๅฎ่ฃ Homebrew๏ผๅฆๆๆฒกๆ๏ผ
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"็ฌฌ 3 ๆญฅ๏ผๅฎ่ฃ Git
brew install git็ฌฌ 1 ๆญฅ๏ผๆๅผ็ป็ซฏ
็ฌฌ 2 ๆญฅ๏ผ่พๅ ฅๅฝไปค
xcode-select --install็ฌฌ 3 ๆญฅ๏ผ็กฎ่ฎคๅฎ่ฃ
- ๅผนๅบๅฏน่ฏๆก่ฏข้ฎๆฏๅฆๅฎ่ฃ
- ็นๅป ๅฎ่ฃ
- ็ญๅพ ๅฎ่ฃ ๅฎๆ
sudo apt update
sudo apt install gitsudo yum install gitsudo pacman -S git็ฌฌ 1 ๆญฅ๏ผๆๅผ็ป็ซฏ/ๅฝไปคๆ็คบ็ฌฆ
็ฌฌ 2 ๆญฅ๏ผ่พๅ ฅไปฅไธๅฝไปค
git --version้ขๆ่พๅบ๏ผ
git version 2.x.x
็ๅฐ็ๆฌๅท่ฏดๆๅฎ่ฃ ๆๅ๏ผ
ๅฎ่ฃ ๅฎๆๅ๏ผ้่ฆ้ ็ฝฎไฝ ็่บซไปฝไฟกๆฏใ่ฟไบไฟกๆฏไผๅบ็ฐๅจไฝ ็ๆฏๆฌกๆไบคไธญใ
็ฌฌ 1 ๆญฅ๏ผๆๅผ็ป็ซฏ/ๅฝไปคๆ็คบ็ฌฆ
็ฌฌ 2 ๆญฅ๏ผ่ฎพ็ฝฎ็จๆทๅ
git config --global user.name "ไฝ ็ๅๅญ"็ฌฌ 3 ๆญฅ๏ผ่ฎพ็ฝฎ้ฎ็ฎฑ
git config --global user.email "your@email.com"็ฌฌ 4 ๆญฅ๏ผ่ฎพ็ฝฎ้ป่ฎคๅๆฏๅ
git config --global init.defaultBranch main็ฌฌ 5 ๆญฅ๏ผ่ฎพ็ฝฎ้ป่ฎค็ผ่พๅจ
# ๅฆๆไฝฟ็จ VS Code
git config --global core.editor "code --wait"
# ๅฆๆไฝฟ็จ Vim
git config --global core.editor "vim"
# ๅฆๆไฝฟ็จ Nano
git config --global core.editor "nano"็ฌฌ 6 ๆญฅ๏ผๅฏ็จ้ข่ฒ่พๅบ
git config --global color.ui auto# ๆฅ็ๆๆ้
็ฝฎ
git config --list
# ๆฅ็็จๆทๅ
git config user.name
# ๆฅ็้ฎ็ฎฑ
git config user.email| ็บงๅซ | ๆไปถไฝ็ฝฎ | ่ฏดๆ |
|---|---|---|
--system |
/etc/gitconfig |
็ณป็ป็บง้ ็ฝฎ |
--global |
~/.gitconfig |
็จๆท็บง้ ็ฝฎ๏ผๆจ่๏ผ |
--local |
.git/config |
ไปๅบ็บง้ ็ฝฎ |
ไผๅ
็บง๏ผlocal > global > system
ไปปๅก 1๏ผๅฎ่ฃ Git
- Windows๏ผไธ่ฝฝๅนถ่ฟ่กๅฎ่ฃ ็จๅบ
- macOS๏ผไฝฟ็จ Homebrew ๅฎ่ฃ
- Linux๏ผไฝฟ็จๅ ็ฎก็ๅจๅฎ่ฃ
ไปปๅก 2๏ผ้ช่ฏๅฎ่ฃ
- ๆๅผ็ป็ซฏ/ๅฝไปคๆ็คบ็ฌฆ
- ่พๅ
ฅ
git --version - ็กฎ่ฎคๆพ็คบ็ๆฌๅท
ไปปๅก 3๏ผ้ ็ฝฎ่บซไปฝไฟกๆฏ
- ่ฎพ็ฝฎ็จๆทๅ๏ผ
git config --global user.name "ไฝ ็ๅๅญ" - ่ฎพ็ฝฎ้ฎ็ฎฑ๏ผ
git config --global user.email "your@email.com" - ๆฅ็้
็ฝฎ๏ผ
git config --list
้ช่ฏๆนๆณ๏ผ
git --versionๆพ็คบ็ๆฌๅทgit config user.nameๆพ็คบไฝ ่ฎพ็ฝฎ็็จๆทๅgit config user.emailๆพ็คบไฝ ่ฎพ็ฝฎ็้ฎ็ฎฑ