Git版本管理工具的最佳學習路徑

Git是一個分散式版本控制軟體,本文介紹了該工具的典型學習路徑,並列數了必須要十分了解的關鍵命令。

獨立基本使用

作為版本管理工具僅為了保留修訂歷史,在不考慮與其他人協作與多版本維護時,你需要熟悉以下命令。

git initgit clone git statusgit add git add ——allgit commitgit remote addgit remote set-urlgit remote -vgit push git pull

關鍵的配置

當你使用的越來越多時你會發現有些操作很繁瑣,這時候你需要學習一些關鍵配置,使你自己的差異訴求得到滿足。

git log git checkout git reset git reset ——hard git clean -f git rm git config ——global user。namegit config ——global user。emailgit stashgit stash applygit stash clear

多人協作使用

當你需要與其他人共同維護一個專案時,你需要掌握相應的分支檢出、分支建立、分支合併、檢視修訂歷史等功能。

git mergegit branchgit checkout git checkout -bgit blame git rebasegit push ——force-with-lease (DANGEROUS)

版本管理員

如果你從事專案的版本管理工作,那麼你需要了解更專業的一些操作,包括更詳細的檢視分支、比較分支、恢復版本、更改修訂、修復版本問題等。

git commit ——amendgit rebase -igit prunegit fetchgit remote prunegit checkout HEAD/HEAD~1/git diff git revert git refloggit-filter-branchgit-filter-repogit bisect

版權宣告,本文首發於 數字魔盒 https://www。dm2box。com/ 歡迎轉載。