🔥 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 - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
同時也有1部Youtube影片,追蹤數超過12萬的網紅prasertcbs,也在其Youtube影片中提到,เชิญสมัครเป็นสมาชิกของช่องนี้ได้ที่ ► https://www.youtube.com/subscription_center?add_user=prasertcbs playlist สอน Jupyter Notebook ► https://www.yout...
「git status」的推薦目錄:
- 關於git status 在 BorntoDev Facebook 的最佳解答
- 關於git status 在 Kewang 的資訊進化論 Facebook 的最讚貼文
- 關於git status 在 prasertcbs Youtube 的最讚貼文
- 關於git status 在 Day09【Git與GitHub】Git 提交流程(上) - iT 邦幫忙 的評價
- 關於git status 在 'git status' shows changed files, but 'git diff' doesn't - Stack ... 的評價
- 關於git status 在 GitHub Status 的評價
- 關於git status 在 Git Guides - git status · GitHub 的評價
- 關於git status 在 處理Git 斷行字元的問題 的評價
- 關於git status 在 Git 筆記- Git初始設定& Github入門 的評價
- 關於git status 在 Git與GitHub介紹,軟體版本控制基本教學|ALPHA Camp Blog 的評價
- 關於git status 在 Determine if Git working directory is clean from a script - Unix ... 的評價
git status 在 Kewang 的資訊進化論 Facebook 的最讚貼文
Microsoft 稍早在 Git-Merge 2017 發表了 GVFS!
顧名思義其實就是把 git 底層做為 file system。原因是在開發大型軟體時的 codebase 太過龐大,像 Windows 就超過 350 萬個檔案而且大小合計超過 270 GB,所以在執行 checkout(3 小時), status(10 分鐘), clone(超過 12 小時) 這類讀取或切換內容時的指令都要花費超多時間,所以改善了 git 無法處理這種超大型 repo 的問題。用了 GVFS 之後,以上幾個指令大幅減少到 30 秒、5 秒、幾分鐘左右。
不過也因為加了 GVFS 這層上去,所以原本 git 指令的底層也做了一些調整。如果要用 GVFS 的話,記得要使用 Microsoft 自己改過的 git 才可以。另外,現在僅支援 Windows,Linux 跟 macOS 要再等等了 (https://github.com/Microsoft/GVFS/issues/4),所以小編現在也沒辦法測試 Orz
PS. 其實之前就看過許多由 git 底層組成的 file system,列在下面大家也可以看看。
* https://github.com/Microsoft/gvfs
* https://github.com/g2p/git-fs
* https://github.com/PressLabs/gitfs
#microsoft #gvfs #git #gitmerge
git status 在 prasertcbs Youtube 的最讚貼文
เชิญสมัครเป็นสมาชิกของช่องนี้ได้ที่ ► https://www.youtube.com/subscription_center?add_user=prasertcbs
playlist สอน Jupyter Notebook ► https://www.youtube.com/playlist?list=PLoTScYm9O0GErrygsfQtDtBT4CloRkiDx
playlist สอน git เบื้องต้น ► https://www.youtube.com/playlist?list=PLoTScYm9O0GGsV1ZAyP4m_iyAbflQrKrX
playlist สอนภาษา Python ► https://www.youtube.com/playlist?list=PLoTScYm9O0GH4YQs9t4tf2RIYolHt_YwW
playlist สอนภาษาไพธอน Python OOP ► https://www.youtube.com/playlist?list=PLoTScYm9O0GEIZzlTKPUiOqkewkWmwadW
playlist สอน Python 3 GUI ► https://www.youtube.com/playlist?list=PLoTScYm9O0GFB1Y3cCmb9aPD5xRB1T11y
playlist สอนภาษา C เบื้องต้น ► https://www.youtube.com/playlist?list=PLoTScYm9O0GHHgz0S1tSyIl7vkG0y105z
playlist สอนภาษา C++ ► https://www.youtube.com/playlist?list=PLoTScYm9O0GEfZwqM2KyCBcPTVsc6cU_i
playlist สอนภาษา C# ► https://www.youtube.com/playlist?list=PLoTScYm9O0GE4trr-XPozJRwaY7V9hx8K
playlist สอนภาษา Java ► https://www.youtube.com/playlist?list=PLoTScYm9O0GF26yW0zVc2rzjkygafsILN
playlist สอนภาษา PHP เบื้องต้น ► https://www.youtube.com/playlist?list=PLoTScYm9O0GH_6LARFxozL_viEsXV2wgO
playlist สอนภาษา R เบื้องต้น ► https://www.youtube.com/playlist?list=PLoTScYm9O0GF6qjrRuZFSHdnBXD2KVICp

git status 在 GitHub Status 的推薦與評價
changes · Git Operations · API Requests · Webhooks · Visit www.githubstatus.com for more information · Issues · Pull Requests · GitHub Actions · GitHub Packages ... ... <看更多>
git status 在 Day09【Git與GitHub】Git 提交流程(上) - iT 邦幫忙 的推薦與評價
✦首先我們要先知道以下四個指令。 檢查狀態:git status; 加入索引:git add . 提交更新:git commit -m '修改記錄'; 查詢記錄: ... ... <看更多>