Skip to content

Git list branch / Git delete branch

เราต้องการแสดง branch ทั้งหมด ถ้าหากต้องการลบ branch ใหม่ ให้ใส่ parameter -D เช่นต้องการลบ branch ชื่อ fixbug/first-feature

Git checkout / Git create branch

เราสามารถทำ checkout branch ได้โดยระบุชื่อ branch เช่น ต้องการ checkout branch ชื่อ test-first-branch แต่ถ้าหากต้องการสร้าง branch ใหม่ ให้ใส่ parameter -b

Git clone แบบเลือก branch

ปกติ ถ้าเรา run git clone จะได้ branch default ( หากไม่มีการเปลี่ยน default branch name ก็จะได้ branch main ) แต่ถ้าหากอยากระบุ branch ตอนที่ สั่ง git clone ก็สามารถทำได้โดยระบุชื่อ ด้วย parameter -b เช่น ต้องการ clone branch name test

Git clone

เราสามารถทำ git clone ได้จาก 2 source 1 http 2 ssh