Skip to content

Commit

Permalink
Add ssh keys and git grep section.
Browse files Browse the repository at this point in the history
Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Sep 25, 2015
1 parent 8a7dd34 commit aaa758c
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions README.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman)
- [從工作區去除大量已刪除文件](#從工作區去除大量已刪除文件)
- [上一個分支](#上一個分支)
- [去除空白](#去除空白)
- [SSH 金鑰](#ssh-金鑰)
- [檢出 Pull Requests](#檢出-pull-requests)
- [沒有任何改動的提交](#沒有任何改動的提交)
- [美化 Git Status](#美化-git-status)
- [美化 Git Log](#美化-git-log)
- [Git 查詢](#git-查詢)
- [Git Grep](#git-grep)
- [合併分支](#合併分支)
- [修復有問題的提交以及自動合併](#修復有問題的提交以及自動合併)
- [以網站方式查看本地倉庫](#以網站方式查看本地倉庫)
Expand Down Expand Up @@ -649,7 +651,21 @@ $ git stripspace < README.md

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

### SSH 金鑰

您可以藉由下面網址得到全部公開的 ssh 金鑰:

```
https://github.com/{user}.keys
```

範例:[https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys)

[*更多詳細 SSH 金鑰資訊...*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/)


### 檢出 Pull Requests

對 Github 倉庫來說,Pull Request 是種特殊分支, 可以通過以下多種方式取到本地:

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

*`q` 鍵退出命令。*

### Git Grep

Git Grep 將顯示匹配字串的行號。

執行:

```bash
$ git grep aliases
```
會找出檔案內有出現 *aliases* 字串。

![git grep aliases](http://i.imgur.com/DL2zpQ9.png)

*`q` 結束搜尋*

你也可以使用多重 flags 來達到進階搜尋。範例:

* `-e` 下一個搜尋匹配條件 (e.g. regex)
* `--and`, `--or` and `--not` 合併多重匹配字串.

使用如下:
```bash
$ git grep -e pattern --and -e anotherpattern
```

[*更多詳細 Git `grep` 指令介紹*](http://git-scm.com/docs/git-grep)

### 合併分支

輸入命令:

```bash
Expand Down

0 comments on commit aaa758c

Please sign in to comment.