Skip to content

Commit 7b430a7

Browse files
committed
add git show
1 parent 5448e76 commit 7b430a7

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ git rebase 就是將 master 的最新 commit 接回來,再補上自己分支
581581

582582
## git pull 補充
583583

584-
既然介紹完了 git fetch 以及 git rebase 之後,接下來我要再補充一些 git pull 額外的 options 參數
584+
既然介紹完了 `git fetch` 以及 `git rebase` 之後,接下來我要再補充一些 `git pull` 額外的 options 參數
585585

586586
```cmd
587587
git pull [<options>] [<repository> [<refspec>…​]]
@@ -600,29 +600,31 @@ git pull --rebase = git fetch + git rebase
600600

601601
看起來比較舒服,所以就使用 `git pull --rebase` 吧 ( 前提是你要知道你在幹嘛 :smile: )。
602602

603-
這邊我模擬 git pull 以及 git pull --rebase 的差異,順便加上衝突的情況,因為步驟蠻多的,
603+
這邊我模擬 `git pull` 以及 `git pull --rebase` 的差異,順便加上衝突的情況,因為步驟蠻多的,
604604

605605
所以如果你想了解更多他的概念,請參考以下手把手教學,
606606

607-
[git pull vs git pull --rebase](https://youtu.be/8h0K-2OaeSk)
607+
[Youtube Tutorial - git pull vs git pull --rebase](https://youtu.be/8h0K-2OaeSk)
608608

609-
使用 git pull 後的結果,code review 的人一定翻桌 ( 如下圖 ):triumph:
609+
使用 `git pull` 後的結果,code review 的人一定翻桌 ( 如下圖 ):triumph:
610610

611-
這邊我有順便模擬衝突的時候,你會發現如果使用 git pull 會多一個 commit (也就是下方的 "fix conflict")。
611+
這邊我有順便模擬衝突的時候,你會發現如果使用 `git pull` 會多一個 commit (也就是下方的 "fix conflict")。
612612

613613
![alt tag](https://i.imgur.com/CNgKR3y.png)
614614

615-
使用 git pull --rebase 後的結果,code review 的人表示溫馨 ( 如下圖 ):innocent:
615+
使用 `git pull --rebase` 後的結果,code review 的人表示溫馨 ( 如下圖 ):innocent:
616616

617-
這邊我有順便模擬衝突的時候,你會發現如果使用 git pull --rebase 並不會像剛剛一樣多了一個 commit,
617+
這邊我有順便模擬衝突的時候,你會發現如果使用 `git pull --rebase` 並不會像剛剛一樣多了一個 commit,
618618

619-
原因是因為當我們使用 git pull --rebase 造成衝突時,修好衝突的內容之後,git add xxxx,接著我們會
619+
原因是因為當我們使用 `git pull --rebase` 造成衝突時,修好衝突的內容之後,git add xxxx,接著我們會
620620

621-
直接執行 git rebase --continue。
621+
直接執行 `git rebase --continue`
622622

623623
![alt tag](https://i.imgur.com/RKMo9ue.png)
624624

625-
假設今天你執行了 git pull --rebase 之後,發現很難受 :fearful:,想要取消,直接執行 `git rebase --abort` 即可回到之前的狀態。
625+
假設今天你執行了 `git pull --rebase` 之後,發現很難受 :fearful:,想要取消,
626+
627+
直接執行 `git rebase --abort` 即可回到之前的狀態。
626628

627629
## git revert
628630

@@ -784,6 +786,22 @@ git stash clear
784786
git stash drop stash@{0}
785787
```
786788

789+
## git show
790+
791+
一般來說,我只用他來看這個 commit 修改了哪些東西
792+
793+
```cmd
794+
git show <commit ID>
795+
```
796+
797+
![alt tag](https://i.imgur.com/rjpl8VL.png)
798+
799+
```cmd
800+
git show [<options>] [<object>…​]
801+
```
802+
803+
其他更詳細的介紹,請參考 [https://git-scm.com/docs/git-show](https://git-scm.com/docs/git-show)
804+
787805
## git 其他設定
788806

789807
我們已經設定了 user.name 以及 user.email ,但 Git 上其實還有很多可設定的東西

0 commit comments

Comments
 (0)