@@ -50,11 +50,13 @@ Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman)
50
50
- [ 從工作區去除大量已刪除文件] ( #從工作區去除大量已刪除文件 )
51
51
- [ 上一個分支] ( #上一個分支 )
52
52
- [ 去除空白] ( #去除空白 )
53
+ - [ SSH 金鑰] ( #ssh-金鑰 )
53
54
- [ 檢出 Pull Requests] ( #檢出-pull-requests )
54
55
- [ 沒有任何改動的提交] ( #沒有任何改動的提交 )
55
56
- [ 美化 Git Status] ( #美化-git-status )
56
57
- [ 美化 Git Log] ( #美化-git-log )
57
58
- [ Git 查詢] ( #git-查詢 )
59
+ - [ Git Grep] ( #git-grep )
58
60
- [ 合併分支] ( #合併分支 )
59
61
- [ 修復有問題的提交以及自動合併] ( #修復有問題的提交以及自動合併 )
60
62
- [ 以網站方式查看本地倉庫] ( #以網站方式查看本地倉庫 )
@@ -649,7 +651,21 @@ $ git stripspace < README.md
649
651
650
652
[ * 進一步了解 Git ` stripspace ` 命令.* ] ( http://git-scm.com/docs/git-stripspace )
651
653
654
+ ### SSH 金鑰
655
+
656
+ 您可以藉由下面網址得到全部公開的 ssh 金鑰:
657
+
658
+ ```
659
+ https://github.com/{user}.keys
660
+ ```
661
+
662
+ 範例:[ https://github.com/tiimgreen.keys ] ( https://github.com/tiimgreen.keys )
663
+
664
+ [ * 更多詳細 SSH 金鑰資訊...* ] ( https://changelog.com/github-exposes-public-ssh-keys-for-its-users/ )
665
+
666
+
652
667
### 檢出 Pull Requests
668
+
653
669
對 Github 倉庫來說,Pull Request 是種特殊分支, 可以通過以下多種方式取到本地:
654
670
655
671
取出某個特定的 Pull Request 並臨時作為本地的 ` FETCH_HEAD ` 中以便進行快速查看更改( diff )以及合併( merge ):
@@ -775,7 +791,35 @@ $ git show :/typo
775
791
776
792
* 按 ` q ` 鍵退出命令。*
777
793
794
+ ### Git Grep
795
+
796
+ Git Grep 將顯示匹配字串的行號。
797
+
798
+ 執行:
799
+
800
+ ``` bash
801
+ $ git grep aliases
802
+ ```
803
+ 會找出檔案內有出現 * aliases* 字串。
804
+
805
+ ![ git grep aliases] ( http://i.imgur.com/DL2zpQ9.png )
806
+
807
+ * 按 ` q ` 結束搜尋*
808
+
809
+ 你也可以使用多重 flags 來達到進階搜尋。範例:
810
+
811
+ * ` -e ` 下一個搜尋匹配條件 (e.g. regex)
812
+ * ` --and ` , ` --or ` and ` --not ` 合併多重匹配字串.
813
+
814
+ 使用如下:
815
+ ``` bash
816
+ $ git grep -e pattern --and -e anotherpattern
817
+ ```
818
+
819
+ [ * 更多詳細 Git ` grep ` 指令介紹* ] ( http://git-scm.com/docs/git-grep )
820
+
778
821
### 合併分支
822
+
779
823
輸入命令:
780
824
781
825
``` bash
0 commit comments