วันเสาร์ที่ 15 สิงหาคม พ.ศ. 2558

คำสั่ง Git basic





git clone  url  
      เป็นคำสั่งดึงข้อมูลจาก Remote repository มาไว้ในเครื่อง local

git branch
     เป็นคำสั่งดู branch ปัจจุบัน

git branch namebranch 
     เป็นคำสั่งกรณีต้องการแตก branch

git branch -d namebranch 
      เป็นคำสั่งกรณีต้องการลบ branch

git checkout namebranch
      เป็นคำสั่งสลับ branch เมื่อต้องการว่าเราอยู่ที่ branch ไหน

git checkout -b namebranch
     เป็นคำสั่งสร้าง branch พร้อมสลับไปยัง branch ที่สร้างใหม่

git status
     เป็นคำสั่งตรวจสอบสถานะที่มีการเปลี่ยนแปลงทั้งเครื่อง local และบน Remote repository

git add ..
     เป็นคำสั่งเพิ่มไฟล์หรือไฟล์ที่เราแก้ไขเพื่อที่จะเอาขึ้น Remote repository

git commit -m"comment" 
       เป็นคำสั่งการยืนยันการเพิ่มไฟล์พร้อมใส่ comment

git pull origin namebranch
      เป็นคำสั่งดึงข้อมูลลงมาจาก Remote repository  มาไว้ในเครื่อง local

git push origin namebranch
      เป็นคำสั่งส่งข้อมูลจากเครื่อง local ไป update บน Remote repository

git fetch origin master
    เป็นคำสั่งดึงไฟล์ทั้งหมดเฉพาะ branch ที่เราต้องการมาไว้บนเครื่อง local

git merge namebranch
     เป็นคำสั่ง merge ไฟล์โดยระบุ branch ที่ต้องการ merge

git log
     เป็นคำสั่งดู log การทำงานทั้งหมด

git rm -r sub_folder
    เป็นคำสั่งใช้ลบไฟล์หรือ folder

ไม่มีความคิดเห็น:

แสดงความคิดเห็น