8000 Merge pull request #74 from tonyxue/master · lazycrazyowl/github-cheat-sheet@2a6b638 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2a6b638

Browse files
author
Rafal Chmiel
committed
Merge pull request tiimgreen#74 from tonyxue/master
Added revert pull request and the branch section
2 parents 3081377 + d6b3a7e commit 2a6b638

File tree

2 files changed

+35
-12
lines changed

2 files changed

+35
-12
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
1111
- [Adjust Tab Space](#adjust-tab-space)
1212
- [Commit History by Author](#commit-history-by-author)
1313
- [Cloning a Repository](#cloning-a-repository)
14-
- [Compare all Branches to Another Branch](#compare-all-branches-to-another-branch)
15-
- [Comparing Branches](#comparing-branches)
16-
- [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories)
14+
- [Branch](#branch)
15+
- [Compare all Branches to Another Branch](#compare-all-branches-to-another-branch)
16+
- [Comparing Branches](#comparing-branches)
17+
- [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories)
1718
- [Gists](#gists)
1819
- [Git.io](#gitio)
1920
- [Keyboard Shortcuts](#keyboard-shortcuts)
@@ -33,6 +34,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
3334
- [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages)
3435
- [Viewing YAML Metadata in your Documents](#viewing-yaml-metadata-in-your-documents)
3536
- [Rendering Tabular Data](#rendering-tabular-data)
37+
- [Revert a Pull Request](#revert-a-pull-request)
3638
- [Diffs](#diffs)
3739
- [Rendered prose Diffs](#rendered-prose-diffs)
3840
- [Diffable Maps](#diffable-maps)
@@ -100,7 +102,8 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet
100102

101103
[*Read more about the Git `clone` command.*](http://git-scm.com/docs/git-clone)
102104

103-
### Compare all Branches to Another Branch
105+
###Branch
106+
#### Compare all Branches to Another Branch
104107

105108
If you go to the repo's [Branches](https://github.com/tiimgreen/github-cheat-sheet/branches) page, next to the Commits button:
106109

@@ -128,7 +131,7 @@ To see the merged branches, append `?merged=1` to the URL.
128131

129132
This view allows you to delete branches easily from the page, without using the command-line.
130133

131-
### Comparing Branches
134+
#### Comparing Branches
132135
To use GitHub to compare branches, change the URL to look like this:
133136

134137
```
@@ -160,7 +163,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master
160163

161164
[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time)
162165

163-
### Compare Branches across Forked Repositories
166+
#### Compare Branches across Forked Repositories
164167
To use GitHub to compare branches across forked repositories, change the URL to look like this:
165168

166169
```
@@ -433,6 +436,15 @@ GitHub supports rendering tabular data in the form of `.csv` (comma-separated) a
433436

434437
[*Read more about rendering tabular data.*](https://github.com/blog/1601-see-your-csvs)
435438

439+
###Revert a Pull Request
440+
After a pull request is merged, you may find it does not help anything or it was a bad decision to merge the pull request.
441+
442+
You can revert it by clicking the **Revert** button on the right side of a commit in the pull request page to create a pull request with reverted changes to this specific pull request.
443+
444+
![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67)
445+
446+
[*Read more about Revert pull request](https://github.com/blog/1857-introducing-the-revert-button)
447+
436448
### Diffs
437449
#### Rendered Prose Diffs
438450
Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views.

README.zh-cn.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
- [调整Tab字符所代表的空格数](#%E8%B0%83%E6%95%B4tab%E5%AD%97%E7%AC%A6%E6%89%80%E4%BB%A3%E8%A1%A8%E7%9A%84%E7%A9%BA%E6%A0%BC%E6%95%B0)
1010
- [查看某个用户的Commit历史](#%E6%9F%A5%E7%9C%8B%E6%9F%90%E4%B8%AA%E7%94%A8%E6%88%B7%E7%9A%84commit%E5%8E%86%E5%8F%B2)
1111
- [克隆某个仓库](#%E5%85%8B%E9%9A%86%E6%9F%90%E4%B8%AA%E4%BB%93%E5%BA%93)
12-
- [将某个分支与其他所有分支进行对比](#%E5%B0%86%E6%9F%90%E4%B8%AA%E5%88%86%E6%94%AF%E4%B8%8E%E5%85%B6%E4%BB%96%E6%89%80%E6%9C%89%E5%88%86%E6%94%AF%E8%BF%9B%E8%A1%8C%E5%AF%B9%E6%AF%94)
13-
- [比较分支](#%E6%AF%94%E8%BE%83%E5%88%86%E6%94%AF)
14-
- [比较不同派生库的分支](#%E6%AF%94%E8%BE%83%E4%B8%8D%E5%90%8C%E6%B4%BE%E7%94%9F%E5%BA%93%E7%9A%84%E5%88%86%E6%94%AF)
12+
- [分支](#%E5%88%86%E6%94%AF)
13+
- [将某个分支与其他所有分支进行对比](#%E5%B0%86%E6%9F%90%E4%B8%AA%E5%88%86%E6%94%AF%E4%B8%8E%E5%85%B6%E4%BB%96%E6%89%80%E6%9C%89%E5%88%86%E6%94%AF%E8%BF%9B%E8%A1%8C%E5%AF%B9%E6%AF%94)
14+
- [比较分支](#%E6%AF%94%E8%BE%83%E5%88%86%E6%94%AF)
15+
- [比较不同派生库的分支](#%E6%AF%94%E8%BE%83%E4%B8%8D%E5%90%8C%E6%B4%BE%E7%94%9F%E5%BA%93%E7%9A%84%E5%88%86%E6%94%AF)
1516
- [Gists](#gists)
1617
- [Git.io](#gitio)
1718
- [键盘快捷键](#%E9%94%AE%E7%9B%98%E5%BF%AB%E6%8D%B7%E9%94%AE)
@@ -31,6 +32,7 @@
3132
- [GitHub Pages的元数据与插件支持](#github-pages%E7%9A%84%E5%85%83%E6%95%B0%E6%8D%AE%E4%B8%8E%E6%8F%92%E4%BB%B6%E6%94%AF%E6%8C%81)
3233
- [查看YAML格式的元数据](#%E6%9F%A5%E7%9C%8Byaml%E6%A0%BC%E5%BC%8F%E7%9A%84%E5%85%83%E6%95%B0%E6%8D%AE)
3334
- [渲染表格数据](#%E6%B8%B2%E6%9F%93%E8%A1%A8%E6%A0%BC%E6%95%B0%E6%8D%AE)
35+
- [撤销Pull Request](#%E6%92%A4%E9%94%80pull-request)
3436
- [Diffs](#diffs)
3537
- [可渲染文档的Diffs](#%E5%8F%AF%E6%B8%B2%E6%9F%93%E6%96%87%E6%A1%A3%E7%9A%84diffs)
3638
- [可变化地图](#%E5%8F%AF%E5%8F%98%E5%8C%96%E5%9C%B0%E5%9B%BE)
@@ -99,7 +101,8 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet
99101

100102
[*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone)
101103

102-
###将某个分支与其他所有分支进行对比
104+
###分支
105+
####将某个分支与其他所有分支进行对比
103106

104107
当你点击某个仓库的分支(Branches)选项卡时
105108

@@ -126,7 +129,7 @@ https://github.com/{user}/{repo}/branches/{branch}
126129

127130
你可以使用这个界面来替代命令行直接删除分支。
128131

129-
### 比较分支
132+
#### 比较分支
130133

131134
如果我们想要比较两个分支,可以像下面一样修改URL:
132135

@@ -159,7 +162,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master
159162

160163
[*了解更多关于比较跨时间段的提交记录.*](https://help.github.com/articles/comparing-commits-across-time)
161164

162-
### 比较不同派生库的分支
165+
#### 比较不同派生库的分支
163166

164167
想要对派生仓库(Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现:
165168

@@ -438,6 +441,14 @@ GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染
438441

439442
[*进一步了解渲染表格数据.*](https://github.com/blog/1601-see-your-csvs)
440443

444+
### 撤销Pull Request
445+
446+
可以通过Pull Request中的Revert按钮来撤销一个已合并的Pull Request中的commit。按下按钮后会自动生成一个进行逆向操作的Pull Request。
447+
448+
![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67)
449+
450+
[*进一步了解“撤销”按钮](https://github.com/blog/1857-introducing-the-revert-button)
451+
441452
### Diffs
442453
#### 可渲染文档的Diffs
443454

0 commit comments

Comments
 (0)
0