個人常用 Git 指令
這個是用來紀錄一下自己會想要用,但常常忘記指令怎麼打的清單。
•1 min read
medium
這個是用來紀錄一下自己會想要用,但常常忘記指令怎麼打的清單。
git diff
統計兩個不同版本的 commit
git diff --stat 統計各個檔案的修改數量
git diff --shortstat 統計全部修改數量
git diff
git rebase
git log
git log --oneline 一行顯示所有的 commit 跟 hash
git log -p 額外多顯示每個 commit 更改的內容
git log -p file 同上,但可以指定只顯示某個檔案相關的 commit
git log --stat 看到每次 commit 修改的檔案以及行數
git log --shortstat 看到每次 commit 修改得總行數
git checkout
git checkout . 把所有修改未 commit 的部份移除