小編最近工作上遇到了大 git repo 的問題,因為 repo 的 history 殘留了許多不必要的內容,像是 logback 的 log、可執行的 jar 檔、測試用的圖檔...等,所以現在的 repo 已經大到 630MB,小編就使用 bfg 將 repo 縮小到只剩 30 MB 左右。
會發現這件事是因為最近在 Jenkins 上面 build 的時候,clone 的時間都花超久,後來才發現原來 repo 太大了 Orz,大家記得不必要的檔案要刪除啊。
執行步驟如下:
1. 下載 bfg
2. 列出檔案最大的前 n 名:git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -50 | awk '{print$1}')"
3. 操作 bare repo:git clone --mirror git://example.com/some-big-repo.git,因為 bfg 會直接操作 bare repo
4. 刪除大檔:bfg --delete-files big-file-*.* some-big-repo.git
5. 壓縮 repo:git reflog expire --expire=now --all && git gc --prune=now --aggressive
6. 上傳回 remote repo:git push
7. 記得請其他開發者先備份 local repo,然後重新 clone 一次 repo。注意:千萬別直接 pull,然後又 push,因為這樣做的話就會把 local repo 的 history 又 push 一次了,這樣子前面的動作就完全沒有用。所以全部的開發者都要重新 clone
8. 快快樂樂使用 repo
BFG Repo-Cleaner:https://rtyley.github.io/bfg-repo-cleaner/
#git #bfg
同時也有3部Youtube影片,追蹤數超過12萬的網紅prasertcbs,也在其Youtube影片中提到,เนื้อหาในคลิปนี้จะเป็นการจำลองสถานการณ์ว่าเรามีไฟล์ต่าง ๆ อยู่ใน folder ก่อนที่จะมาใช้ git และ github โดยสาธิตให้เห็นถึงขั้นตอนในการ ► 03:32 ทำ git i...
「git remote list」的推薦目錄:
- 關於git remote list 在 Kewang 的資訊進化論 Facebook 的最佳貼文
- 關於git remote list 在 prasertcbs Youtube 的最佳解答
- 關於git remote list 在 prasertcbs Youtube 的最讚貼文
- 關於git remote list 在 prasertcbs Youtube 的最佳解答
- 關於git remote list 在 List of remotes for a Git repository? - Stack Overflow 的評價
- 關於git remote list 在 Managing remote repositories - GitHub Docs 的評價
- 關於git remote list 在 git remote list your remote aliases - Git Reference 的評價
- 關於git remote list 在 GitHub for complete beginners - The MDN project 的評價
- 關於git remote list 在 Git 远程仓库(Github) | 菜鸟教程 的評價
- 關於git remote list 在 6 places to host your git repository | Opensource.com 的評價
- 關於git remote list 在 Git GitHub Add SSH - W3Schools 的評價
- 關於git remote list 在 Github compare two prs. If some line is added, de - SOLID ... 的評價
git remote list 在 prasertcbs Youtube 的最佳解答
เนื้อหาในคลิปนี้จะเป็นการจำลองสถานการณ์ว่าเรามีไฟล์ต่าง ๆ อยู่ใน folder ก่อนที่จะมาใช้ git และ github โดยสาธิตให้เห็นถึงขั้นตอนในการ
► 03:32 ทำ git init เพื่อสร้าง local repository ขึ้นมา
► 04:25 การสร้าง remote repository บน github
► 07:54 การกำหนด user.name และ email ของ git (สร้างไฟล์ .gitconfig)
► 09:07 การ commit change ด้วย Visual Studio Code
► 09:30 การ push (ส่ง) ไฟล์จาก local repository ไปยัง remote repository (บน github)
► 13:21 การ pull (ดึง) ไฟล์จาก remote repository (บน github) ลงมายัง local repository (local hard drive)
► 14:37 การ sync (push/pull) ไฟล์จาก local และ remote repository
เชิญสมัครเป็นสมาชิกของช่องนี้ได้ที่ ► https://www.youtube.com/subscription_center?add_user=prasertcbs
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
#prasertcbs #prasertcbs_git #prasertcbs_github

git remote list 在 prasertcbs Youtube 的最讚貼文
► 02:28 การใช้ git clone เพื่อทำการ clone หรือ copy remote repository ที่ต้องการจาก github มายัง local repository ในเครื่องคอมพิวเตอร์ส่วนตัวของเรา
► 04:30 การใช้ git pull เพื่อดึงไฟล์ที่มีการเปลี่ยนแปลงจาก remote repository บน github มายัง local repository
เชิญสมัครเป็นสมาชิกของช่องนี้ได้ที่ ► https://www.youtube.com/subscription_center?add_user=prasertcbs
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 #github #git_repository #git_push #git_config #git_clone

git remote list 在 prasertcbs Youtube 的最佳解答
เนื้อหาจะเป็นการจำลองสถานการณ์ว่าเราได้พัฒนาโปรแกรมขึ้นมา โดย source code เก็บอยู่ใน folder โดยไม่มีการใช้โปรแกรมสำหรับจัดการเวอร์ชั่นของซอฟแวร์มาก่อน ลองมาดูว่าหากต้องการใช้ git เพื่อที่จะทำ version control ให้กับ source code ใน folder นี้จะต้องทำอย่างไร โดยมีคำสั่งหลัก ๆ ที่ใช้เรียงตามลำดับดังนี้
การใช้ git init เพื่อสร้าง local repository ให้กับ project/folder
การใช้ git config --global user.name "username" เพื่อกำหนดชื่อผู้ใช้
การใช้ git config --global user.email "me@anyemail.com" เพื่อกำหนด email ของผู้ใช้
การใช้ git add .
การใช้ git commit
การใช้ git remote add origin https://github.com/prasertcbs/atlas.git
การใช้ git push -u origin master
เชิญสมัครเป็นสมาชิกของช่องนี้ได้ที่ ► https://www.youtube.com/subscription_center?add_user=prasertcbs
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
#prasertcbs #prasertcbs_git #prasertcbs_github

git remote list 在 Managing remote repositories - GitHub Docs 的推薦與評價
List your existing remotes in order to get the name of the remote you want to change. $ git remote -v > origin [email protected]:USERNAME/REPOSITORY.git ... ... <看更多>
git remote list 在 git remote list your remote aliases - Git Reference 的推薦與評價
git remote list your remote aliases ... Without any arguments, Git will simply show you the remote repository aliases that it has stored. By default, if you ... ... <看更多>
git remote list 在 List of remotes for a Git repository? - Stack Overflow 的推薦與評價
... <看更多>
相關內容