GIT คือ Version Control system.
GIT ใช้ในการ Tracking การเปลี่ยนแปลงของ Code ว่าใครเป็นคนแก้ไข เพื่อใช้ในกรณีที่มีการเขียน Code มากกว่า 1 คน
GIT ใช้ Repositories ในการบริหารจัดการ Projects สามารถ Clone or Update Project มาไว้ในเครื่อง Local ได้ด้วยคำสั่ง Pull โดยควบคุม ติดตาม ผ่านการทำ Staging และ Committing และทำการ Push ข้อมูลจาก Local ขึ้น Project ทั้งนี้สามารถ Revert version ได้เนื่องจากเก็บไว้แบบ Full History
"GIT ไม่ใช่ GITHub"
1. ติดตั้ง GIT
Download ที่ Git (git-scm.com)
Next ตลอด
จะได้ GIT Bash มาใช้งาน
2. ตรวจสอบการติดตั้ง Check Version $git --version
$ git --version
git version 2.44.0.windows.1
3. Configure GIT เพื่อให้รู้ว่า ใคร เป็่นคนใช้ (เหมือนการ login)
$git config user.name "username"
$git config user.email "yourname@yourdomain.com"
4. ระบุ Folder ที่จะใช้ GIT $git init
เข้าไปที่ Folder ที่ต้องการใช้ GIT แล้วใช้คำสั่ง
cd /projectpath/
cd /projectpath/
$git init
Initialized empty Git repository in /projectpath/.git/
5. ตรวจ Status ของ GIT ว่าใช้งานได้หรือไม่
$git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
index.html
nothing added to commit but untracked files present (use "git add" to track)
ความคิดเห็น
แสดงความคิดเห็น