🔥 Git เป็น Version Control ที่ใช้จัดเก็บและควบคุมการเปลี่ยนแปลงที่เกิดขึ้นกับไฟล์ชนิดต่างๆ เช่น Text file, Source Code เป็นต้น
.
✍️ ซึ่งมันจะใช้เก็บบันทึกการเปลี่ยนแปลงของ Source Code เวอร์ชันล่าสุดที่เครื่องของเรา (Local Repository) สามารถทำงานได้โดยที่ไม่ต้องใช้เน็ต หากต้องการอัปเดต หรือเปลี่ยนแปลงก็สามารถทำการ Push ขึ้นไปเก็บที่ Remote Repository ได้นั่นเอง!
.
🔎 มันมีคำสั่งอะไร แล้วแต่ละอย่างใช้ทำอะไรบ้างไปดูกันเลยจ้า
.
⭐ 1) Git clone - ใช้ดาวน์โหลด/คัดลอกโปรเจกต์จาก Remote Repository ไว้ในเครื่องของเรา
.
คำสั่ง
git clone
⭐ 2) Git branch - สร้าง ลบ และเรียกดู Branch ได้ตามต้องการ
.
คำสั่งสร้าง Branch ใหม่
git branch
.
คำสั่งลบ Branch
git branch -d
⭐ 3) Git checkout - ใช้เปลี่ยน Branch ในการทำงาน
.
คำสั่ง
git checkout
.
หรือสามารถสร้าง Branch ใหม่และเรียกใช้ทันที ด้วยคำสั่ง
git checkout -b
⭐ 4) Git status - ใช้เช็คสถานะของไฟล์ต่างๆ ในโปรเจกต์ของเรา เช่น
.
คำสั่ง
git status
.
⭐ 5) Git add - ใช้สำหรับอัปเดตเวอร์ชันใหม่ของ Code ที่ถูกแก้ไขหรือสร้างใหม่ขึ้นบน Stage
.
คำสั่ง (ระบุชื่อไฟล์ที่ต้องการ)
git add
.
คำสั่ง (ไฟล์ทั้งหมดในโฟลเดอร์)
git add -A
.
⭐ 6) Git commit - ใช้สำหรับยืนยันการเปลี่ยนแปลงของไฟล์ที่ถูก Add ขึ้นมาบน Stage และสามารถใส่ Comment สั้นๆ ได้ด้วย
.
คำสั่ง
git commit -m "commit message"
.
⭐ 7) Git push - ใช้สำหรับอัปเดต Code ที่ถูก Commit ขึ้นบน Remote Repository
git push
.
แต่ถ้าเราเขียน Code ใน Branch ใหม่ที่ยังไม่มีบน Remote Repository ให้ใช้คำสั่ง
git push --set-upstream
.
หรือ
git push -u origin
.
⭐ 8) Git pull - รับการอัปเดตจาก Remote Repository มาในเครื่องของเรา
.
คำสั่ง
git pull
.
⭐ 9) Git revert - คำสั่งยกเลิกการอัปเดตจากฝั่งเราออกจาก Remote Repository
*ต้องใช้อย่างระวังเพราะอาจจะพลาดลบบางอย่างที่ไม่ต้องการได้
.
คำสั่ง
git revert
.
⭐ 10) Git merge - ใช้สำหรับรวม Branch ที่ต้องการเข้าด้วยกัน
.
คำสั่ง
git merge
.
ครบแล้วกับ 10 คำสั่ง Git เบื้องต้นที่มือใหม่ควรรู้ หวังว่าจะเป็นประโยชน์กับเพื่อนๆ นะคะ 😍
.
borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
「git stage」的推薦目錄:
- 關於git stage 在 BorntoDev Facebook 的最佳解答
- 關於git stage 在 What does 'stage' mean in git? - Software Engineering Stack ... 的評價
- 關於git stage 在 Using the Git staging area - Git introduction 的評價
- 關於git stage 在 GitHub 及EGit ( PART 3 / 8 ) + Git stage - 放棄思考 的評價
- 關於git stage 在 Lightning Talk: Git add -p - gists · GitHub 的評價
- 關於git stage 在 Stage hunk non-interactively in git - Stack Overflow 的評價
- 關於git stage 在 Git and GitHub Tutorials #7 - Staging Changes and Making ... 的評價
- 關於git stage 在 Git and GitHub Tutorials #7 - Staging Changes and Making ... 的評價
- 關於git stage 在 Chapter 18 Git and GitHub | R Packages 的評價
- 關於git stage 在 Version Controlling with Git in Visual Studio Code and GitHub 的評價
- 關於git stage 在 Git 與Github 版本控制基本指令與操作入門教學 - TechBridge ... 的評價
git stage 在 Using the Git staging area - Git introduction 的推薦與評價
In your recipe example, make two different changes to ingredients.txt and instructions. · Use git add to stage one of the changes. · Use git status to see what's ... ... <看更多>
git stage 在 GitHub 及EGit ( PART 3 / 8 ) + Git stage - 放棄思考 的推薦與評價
那個Eclipse workspace 跟Local Git Repo 的關係是?別心急,Egit 還有一個View 沒有解說過——【Git Staging】。 EGit Staging 周期流程. 本 ... ... <看更多>
git stage 在 What does 'stage' mean in git? - Software Engineering Stack ... 的推薦與評價
To "stage" is to do git add file.ext for a specific file, or git add . to affect all modified and untracked files. Files that have been added in this way are ... ... <看更多>
相關內容