Please enable JavaScript.
Coggle requires JavaScript to display documents.
git (คำสั่งหลักๆ (git clone git_url โคลนไฟล์จาก gitlab …
git
คำสั่งหลักๆ
git clone git_url
โคลนไฟล์จาก gitlab
ถ้าเกิดปัญหาจากการ login ให้ใช้
git clone
https://username:password@git_url.git
git remote add origin git_url
ตั้งตำแหน่ง
git add .
เพิ่มไฟล์ทั้งหมดไปยัง gitlab
git commit -m "text"
commit text
git push
ส่งไฟล์ไปใส่ gitlab
git pull
ดึงไฟล์ล่าสุดจาก gitlab
git checkout branch
ย้าย branch
git checkout -b branch
สร้าง branch ใหม่
git remote -v
ดูตำแหน่ง remote ปัจจุบัน
git branch -a
ดู branch ทั้งหมด
git pull branch
ดึง branch
git reset --soft HEAD~1
ย้อนไฟล์ก่อนหน้านี้
git add filename
เพิ่มไฟล์ตามชื่อ
git pull origin feature/login
ดึงไฟล์จาก branch อื่นมา branch ที่เลือก
git remote set-url origin
https://gitlab.com/drivezer01/webshopmc
เปลี่ยน remote url
git merge branchname
ทำการ merge code เข้ามาใน master
git stash
discard all (ยกเลิกไฟล์ที่ถูกเปลี่ยนแปลงทั้งหมด)
git fetch origin
อัพเดท branch ที่สร้างใหม่
ปัญหา
ถ้า login ผิด เวลาใส่ลิ้งต้องใส่
https://username:password@git_url.git
ถ้าไฟล์ push ไม่ได้อาจเป็นเพราะไฟล์เราไม่ล่าสุดให้ pull มาใหม่ก่อน
ไม่มีไฟล์ modul ให้ npm install ก่อนเพื่อติดตั้ง modul
npm install ngx-bootstrap --save
pull จาก branch อื่นมา master ให้ pull origin ก่อน แล้ว add . > commit > push
git push -u origin master
เตือน
กด + หน้า Changes ก่อน commit
commit ก่อนจึงจะ push
เกี่ยวข้อง
http://up1.github.io/git-guide/index.th.html