8000 Add ssh keys and git grep section. · adamadeane/github-cheat-sheet@aaa758c · GitHub
[go: up one dir, main page]

Skip to content

Commit aaa758c

Browse files
committed
Add ssh keys and git grep section.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent 8a7dd34 commit aaa758c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

README.zh-tw.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman)
5050
- [從工作區去除大量已刪除文件](#從工作區去除大量已刪除文件)
5151
- [上一個分支](#上一個分支)
5252
- [去除空白](#去除空白)
53+
- [SSH 金鑰](#ssh-金鑰)
5354
- [檢出 Pull Requests](#檢出-pull-requests)
5455
- [沒有任何改動的提交](#沒有任何改動的提交)
5556
- [美化 Git Status](#美化-git-status)
5657
- [美化 Git Log](#美化-git-log)
5758
- [Git 查詢](#git-查詢)
59+
- [Git Grep](#git-grep)
5860
- [合併分支](#合併分支)
5961
- [修復有問題的提交以及自動合併](#修復有問題的提交以及自動合併)
6062
- [以網站方式查看本地倉庫](#以網站方式查看本地倉庫)
@@ -649,7 +651,21 @@ $ git stripspace < README.md
649651

650652
[*進一步了解 Git `stripspace` 命令.*](http://git-scm.com/docs/git-stripspace)
651653

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+
652667
### 檢出 Pull Requests
668+
653669
對 Github 倉庫來說,Pull Request 是種特殊分支, 可以通過以下多種方式取到本地:
654670

655671
取出某個特定的 Pull Request 並臨時作為本地的 `FETCH_HEAD` 中以便進行快速查看更改( diff )以及合併( merge ):
@@ -775,7 +791,35 @@ $ git show :/typo
775791

776792
*`q` 鍵退出命令。*
777793

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+
778821
### 合併分支
822+
779823
輸入命令:
780824

781825
```bash

0 commit comments

Comments
 (0)
0