Git Command
เริ่มต้นสร้าง Git repository หรือสร้างโฟลเดอร์ .git (hidden folder) ด้วยคำสั่ง git init เพิ่มไฟล์เข้าไปใน staging area ด้วยคำสั่ง git add <file name> หรือ git add . เพื่อ add ไฟล์ทั้งหมด Commit ไฟล์ไปยัง local repository ด้วยคำสั่ง git commit -m "<commit-message>" ตรวจสอบสถานะของไฟล์ด้วยคำสั่ง git status ตรวจสอบ remote repository ด้วยคำสั่ง git remote -v Add remote repository ด้วยคำสั่ง git remote add <remote-name> <remote-url> เปลี่ยน remote url ด้วยคำสั่ง git remote set-url <remote-name> <new-remote-url> ลบ remote repository ด้วยคำสั่ง git remote rm <remote-name> ตรวจสอบ branch ปัจจุบันด้วยคำสั่ง git branch ตรวจสอบ branch ทั้งหมดด้วยคำสั่ง git branch -a เปลี่ยนชื่อ branch ปัจจุบันด้วยคำสั่ง git branch -M <new-branch-name> สร้าง branch ใหม่ด้วยคำสั่ง git branch <new-branch-name> เปลี่ยน branch ปัจจุบันด้วยคำสั่ง git checkout <branch-name> ลบ local branch ด้วยคำสั่ง git branch -d <branch-name> ลบ remote branch ...