Git Command

Thanaroj chareonphuthiwat
1 min readJan 15, 2019

--

##git revert

ใช้ตอนที่ ต้องการ ยกเลิกรายการที่เราได้ทำเช่น ลบ แก้ไข

git revert finame

## เปลี่ยน Branch

ขณะที่เรากำลัง Dev อยู่ สามารถ เปลี่ยนไป Dev อีก Branch ได้ โดยใช้คำสั่งตามนี้

git checkout -b <branch>

**กรณีที่มี Branch อยู่แล้วให้ใช้คำสั่ง Switch branch ดังนี้

git checkout <branch>

**หลังจากเปลี่ยน Branch กรณีที่ จะ Pull Source จะต้อง ทำดังนี้

git branch --set-upstream-to=origin/<branch> <branch>

git pull

**กรณีที่ Dev หลาย Branch ตอน Push ให้ระบุ ดังนี้

git push --set-upstream origin <branch>

--

--

No responses yet