1
0
mirror of https://github.com/tiimgreen/github-cheat-sheet.git synced 2025-08-08 08:56:35 +02:00

Merge pull request #74 from tonyxue/master

Added revert pull request and the branch section
This commit is contained in:
Rafal Chmiel
2014-06-25 12:23:38 +01:00
2 changed files with 35 additions and 12 deletions

View File

@@ -11,9 +11,10 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
- [Adjust Tab Space](#adjust-tab-space)
- [Commit History by Author](#commit-history-by-author)
- [Cloning a Repository](#cloning-a-repository)
- [Compare all Branches to Another Branch](#compare-all-branches-to-another-branch)
- [Comparing Branches](#comparing-branches)
- [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories)
- [Branch](#branch)
- [Compare all Branches to Another Branch](#compare-all-branches-to-another-branch)
- [Comparing Branches](#comparing-branches)
- [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories)
- [Gists](#gists)
- [Git.io](#gitio)
- [Keyboard Shortcuts](#keyboard-shortcuts)
@@ -33,6 +34,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
- [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages)
- [Viewing YAML Metadata in your Documents](#viewing-yaml-metadata-in-your-documents)
- [Rendering Tabular Data](#rendering-tabular-data)
- [Revert a Pull Request](#revert-a-pull-request)
- [Diffs](#diffs)
- [Rendered prose Diffs](#rendered-prose-diffs)
- [Diffable Maps](#diffable-maps)
@@ -100,7 +102,8 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet
[*Read more about the Git `clone` command.*](http://git-scm.com/docs/git-clone)
### Compare all Branches to Another Branch
###Branch
#### Compare all Branches to Another Branch
If you go to the repo's [Branches](https://github.com/tiimgreen/github-cheat-sheet/branches) page, next to the Commits button:
@@ -128,7 +131,7 @@ To see the merged branches, append `?merged=1` to the URL.
This view allows you to delete branches easily from the page, without using the command-line.
### Comparing Branches
#### Comparing Branches
To use GitHub to compare branches, change the URL to look like this:
```
@@ -160,7 +163,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master
[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time)
### Compare Branches across Forked Repositories
#### Compare Branches across Forked Repositories
To use GitHub to compare branches across forked repositories, change the URL to look like this:
```
@@ -433,6 +436,15 @@ GitHub supports rendering tabular data in the form of `.csv` (comma-separated) a
[*Read more about rendering tabular data.*](https://github.com/blog/1601-see-your-csvs)
###Revert a Pull Request
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.
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.
![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67)
[*Read more about Revert pull request](https://github.com/blog/1857-introducing-the-revert-button)
### Diffs
#### Rendered Prose Diffs
Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views.

View File

@@ -9,9 +9,10 @@
- [调整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)
- [查看某个用户的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)
- [克隆某个仓库](#%E5%85%8B%E9%9A%86%E6%9F%90%E4%B8%AA%E4%BB%93%E5%BA%93)
- [将某个分支与其他所有分支进行对比](#%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)
- [比较分支](#%E6%AF%94%E8%BE%83%E5%88%86%E6%94%AF)
- [比较不同派生库的分支](#%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)
- [分支](#%E5%88%86%E6%94%AF)
- [将某个分支与其他所有分支进行对比](#%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)
- [比较分支](#%E6%AF%94%E8%BE%83%E5%88%86%E6%94%AF)
- [比较不同派生库的分支](#%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)
- [Gists](#gists)
- [Git.io](#gitio)
- [键盘快捷键](#%E9%94%AE%E7%9B%98%E5%BF%AB%E6%8D%B7%E9%94%AE)
@@ -31,6 +32,7 @@
- [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)
- [查看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)
- [渲染表格数据](#%E6%B8%B2%E6%9F%93%E8%A1%A8%E6%A0%BC%E6%95%B0%E6%8D%AE)
- [撤销Pull Request](#%E6%92%A4%E9%94%80pull-request)
- [Diffs](#diffs)
- [可渲染文档的Diffs](#%E5%8F%AF%E6%B8%B2%E6%9F%93%E6%96%87%E6%A1%A3%E7%9A%84diffs)
- [可变化地图](#%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
[*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone)
###将某个分支与其他所有分支进行对比
###分支
####将某个分支与其他所有分支进行对比
当你点击某个仓库的分支Branches选项卡时
@@ -126,7 +129,7 @@ https://github.com/{user}/{repo}/branches/{branch}
你可以使用这个界面来替代命令行直接删除分支。
### 比较分支
#### 比较分支
如果我们想要比较两个分支可以像下面一样修改URL
@@ -159,7 +162,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master
[*了解更多关于比较跨时间段的提交记录.*](https://help.github.com/articles/comparing-commits-across-time)
### 比较不同派生库的分支
#### 比较不同派生库的分支
想要对派生仓库Forked Repository之间的分支进行比较可以像下面这样修改URL实现
@@ -438,6 +441,14 @@ GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染
[*进一步了解渲染表格数据.*](https://github.com/blog/1601-see-your-csvs)
### 撤销Pull Request
可以通过Pull Request中的Revert按钮来撤销一个已合并的Pull Request中的commit。按下按钮后会自动生成一个进行逆向操作的Pull Request。
![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67)
[*进一步了解“撤销”按钮](https://github.com/blog/1857-introducing-the-revert-button)
### Diffs
#### 可渲染文档的Diffs