Skip to content

Commit cdc4369

Browse files
committed
Merge branch 'master' into korean
2 parents 2f281dd + d3b0586 commit cdc4369

1 file changed

Lines changed: 133 additions & 12 deletions

File tree

README.md

Lines changed: 133 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
1414
- [Line Highlighting in Repositories](#line-highlighting-in-repositories)
1515
- [Closing Issues via Commit Messages](#closing-issues-via-commit-messages)
1616
- [Cross-Link Issues](#cross-link-issues)
17+
- [CI Status on Pull Requests](#ci-status-on-pull-requests)
1718
- [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files)
1819
- [Emojis](#emojis)
1920
- [Images/GIFs](#imagesgifs)
@@ -27,11 +28,15 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
2728
- [Rendered prose Diffs](#rendered-prose-diffs)
2829
- [Diffable Maps](#diffable-maps)
2930
- [Expanding Context in Diffs](#expanding-context-in-diffs)
31+
- [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request)
3032
- [Hub](#hub)
3133
- [Decreasing Contributor Friction](#decreasing-contributor-friction)
3234
- [Contributing Guidelines](#contributing-guidelines)
35+
- [GitHub Resources](#github-resources)
36+
- [GitHub Talks](#github-talks)
3337
- [Git](#git)
3438
- [Previous Branch](#previous-branch)
39+
- [Stripspace](#stripspace)
3540
- [Checking out Pull Requests](#checking-out-pull-requests)
3641
- [Empty Commits :trollface:](#empty-commits-trollface)
3742
- [Styled Git Status](#styled-git-status)
@@ -43,11 +48,15 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c
4348
- [Aliases](#aliases)
4449
- [Auto-Correct](#auto-correct)
4550
- [Color](#color)
51+
- [Git Resources](#git-resources)
52+
- [Git Books](#git-books)
4653

4754
## GitHub
4855
### Ignore Whitespace
4956
Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed.
5057

58+
![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67)
59+
5160
[*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets)
5261

5362
### Commit History by Author
@@ -57,6 +66,8 @@ To view all commits on a repo by author add `?author=username` to the URL.
5766
https://github.com/rails/rails/commits/master?author=dhh
5867
```
5968

69+
![DHH commit history](http://i.imgur.com/mDWwuaY.png)
70+
6071
[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views)
6172

6273
### Cloning a Repository
@@ -78,17 +89,24 @@ https://github.com/user/repo/compare/{range}
7889
Where `{range} = master...4-1-stable`
7990

8091
For example:
92+
8193
```
8294
https://github.com/rails/rails/compare/master...4-1-stable
8395
```
8496

97+
![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png)
98+
8599
`{range}` can be changed to things like:
86100

87101
```
88102
https://github.com/rails/rails/compare/master@{1.day.ago}...master
89103
https://github.com/rails/rails/compare/master@{2014-10-04}...master
90104
```
91105

106+
*Dates are in the format `YYYY-DD-MM`*
107+
108+
![Another compare example](http://i.imgur.com/5dtzESz.png)
109+
92110
...which allows you to see the difference on the master branch up a set time ago or a specified date.
93111

94112
[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time)
@@ -103,11 +121,17 @@ https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch}
103121
For example:
104122

105123
```
106-
https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master
124+
https://github.com/rails/rails/compare/byroot:master...master
107125
```
108126

127+
![Forked branch compare](http://i.imgur.com/Q1W6qcB.png)
128+
109129
### Gists
110-
[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repository. Add `.pibb` to the end of any Gist URL ([like this](https://gist.github.com/tiimgreen/10545817.pibb)) in order to get the *HTML only* version suitable for embedding in any other site.
130+
[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repository.
131+
132+
![Gist](http://i.imgur.com/VkKI1LC.png?1)
133+
134+
Add `.pibb` to the end of any Gist URL ([like this](https://gist.github.com/tiimgreen/10545817.pibb)) in order to get the *HTML only* version suitable for embedding in any other site.
111135

112136
Gists can be treated as a full repository so they can be cloned like any other:
113137

@@ -120,7 +144,11 @@ $ git clone https://gist.github.com/tiimgreen/10545817
120144
[*Read more about creating gists.*](https://help.github.com/articles/creating-gists)
121145

122146
### Git.io
123-
[Git.io](http://git.io) is a simple URL shortener for GitHub. You can also use it via pure HTTP using Curl:
147+
[Git.io](http://git.io) is a simple URL shortener for GitHub.
148+
149+
![Git.io](http://i.imgur.com/6JUfbcG.png?1)
150+
151+
You can also use it via pure HTTP using Curl:
124152

125153
```bash
126154
$ curl -i http://git.io -F "url=https://github.com/..."
@@ -143,7 +171,9 @@ When on a repository page, keyboard shortcuts allow you to navigate easily.
143171
- Pressing `l` will edit labels on existing Issues.
144172
- Pressing `y` **when looking at a file** (e.g. `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`) will change your URL to one which, in effect, freezes the page you are looking at. If this code changes, you will still be able to see what you saw at that current time.
145173

146-
To see all of the shortcuts for the current page press `?`.
174+
To see all of the shortcuts for the current page press `?`:
175+
176+
![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png)
147177

148178
[*Read more about using the Command Bar.*](https://help.github.com/articles/using-the-command-bar)
149179

@@ -178,6 +208,13 @@ To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e.
178208

179209
![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67)
180210

211+
### CI Status on Pull Requests
212+
If set up correctly, every time you receive a Pull Request, [Travis CI](https://travis-ci.org/) will build that Pull Request just like it would every time you make a new commit. Read more about how to [get started with Travis CI](http://docs.travis-ci.com/user/getting-started/).
213+
214+
[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452)
215+
216+
[*Read more about the commit status API.*](https://github.com/blog/1227-commit-status-api)
217+
181218
### Syntax Highlighting in Markdown Files
182219
For example, to syntax highlight Ruby code in your Markdown files write:
183220

@@ -212,7 +249,7 @@ Would produce:
212249

213250
:smile:
214251

215-
The full list of supported Emojis on GitHub can be found [here](http://www.emoji-cheat-sheet.com/) or [here](https://github.com/scotch-io/All-Github-Emoji-Icons).
252+
The full list of supported Emojis on GitHub can be found at [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) or [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons).
216253

217254
The top 5 used Ejmojis on GitHub are:
218255

@@ -302,7 +339,7 @@ Within Jekyll pages and posts, repository information is available within the `s
302339

303340
The Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](https://github.com/blog/821) in your Jekyll posts and pages to work just like you'd expect when interacting with a repository on GitHub.com.
304341

305-
[*Read more about repository metadata and plugin support for GitHub Pages.*](Repository metadata and plugin support for GitHub Pages)
342+
[*Read more about repository metadata and plugin support for GitHub Pages.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages)
306343

307344
### Diffs
308345
#### Rendered Prose Diffs
@@ -330,6 +367,37 @@ Using the *unfold* button in the gutter of a diff, you can reveal additional lin
330367

331368
[*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs)
332369

370+
#### Diff or Patch of Pull Request
371+
You can get the diff of a Pull Request by adding a `.diff` or `.patch`
372+
extension to the end of the URL. For example:
373+
374+
```
375+
https://github.com/tiimgreen/github-cheat-sheet/pull/15
376+
https://github.com/tiimgreen/github-cheat-sheet/pull/15.diff
377+
https://github.com/tiimgreen/github-cheat-sheet/pull/15.patch
378+
```
379+
380+
The `.diff` extension would give you this in plain text:
381+
382+
```
383+
diff --git a/README.md b/README.md
384+
index 88fcf69..8614873 100644
385+
--- a/README.md
386+
+++ b/README.md
387+
@@ -28,6 +28,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i
388+
- [Merged Branches](#merged-branches)
389+
- [Quick Licensing](#quick-licensing)
390+
- [TODO Lists](#todo-lists)
391+
+- [Relative Links](#relative-links)
392+
- [.gitconfig Recommendations](#gitconfig-recommendations)
393+
- [Aliases](#aliases)
394+
- [Auto-correct](#auto-correct)
395+
@@ -381,6 +382,19 @@ When they are clicked, they will be updated in the pure Markdown:
396+
- [ ] Sleep
397+
398+
(...)
399+
```
400+
333401
### Hub
334402
[Hub](https://github.com/github/hub) is a command line Git wrapper that gives you extra features and commands that make working with GitHub easier.
335403

@@ -339,12 +407,6 @@ This allows you to do things like:
339407
$ hub clone tiimgreen/toc
340408
```
341409

342-
...instead of:
343-
344-
```bash
345-
$ git clone https://github.com/tiimgreen/toc.git
346-
```
347-
348410
[*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands)
349411

350412
### Decreasing Contributor Friction
@@ -361,6 +423,24 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y
361423

362424
[*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines)
363425

426+
### GitHub Resources
427+
| Title | Link |
428+
| ----- | ---- |
429+
| GitHub Explore | https://github.com/explore |
430+
| GitHub Blog | https://github.com/blog |
431+
| GitHub Help | https://help.github.com/ |
432+
| GitHub Training | http://training.github.com/ |
433+
| GitHub Developer | https://developer.github.com/ |
434+
435+
#### GitHub Talks
436+
| Title | Link |
437+
| ----- | ---- |
438+
| How GitHub Uses GitHub to Build GitHub | https://www.youtube.com/watch?v=qyz3jkOBbQY |
439+
| Introduction to Git with Scott Chacon of GitHub | https://www.youtube.com/watch?v=ZDR433b0HJY |
440+
| How GitHub No Longer Works | https://www.youtube.com/watch?v=gXD1ITW7iZI |
441+
| Git and GitHub Secrets | https://www.youtube.com/watch?v=Foz9yvMkvlA |
442+
| More Git and GitHub Secrets | https://www.youtube.com/watch?v=p50xsL-iVgU |
443+
364444
## Git
365445
### Previous Branch
366446
To move to the previous branch in Git:
@@ -378,6 +458,21 @@ $ git checkout -
378458

379459
[*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging)
380460

461+
### Stripspace
462+
463+
Git Stripspace:
464+
465+
- Strips trailing whitespace
466+
- Collapses newlines
467+
- Adds newline to end of file
468+
469+
A file must be passed when calling the command, e.g.:
470+
```bash
471+
$ git stripspace < README.md
472+
```
473+
474+
[*Read more about the Git `stripspace` command.*](http://git-scm.com/docs/git-stripspace)
475+
381476
### Checking out Pull Requests
382477
If you want to check out pull request locally, you can fetch it using that command:
383478

@@ -603,3 +698,29 @@ $ git config --global color.ui 1
603698
```
604699

605700
[*Read more about the Git `config` command.*](http://git-scm.com/docs/git-config)
701+
702+
### Git Resources
703+
| Title | Link |
704+
| ----- | ---- |
705+
| Official Git Site | http://git-scm.com/ |
706+
| Official Git Video Tutorials | http://git-scm.com/videos |
707+
| Code School Try Git | http://try.github.com/ |
708+
| Introductory Reference & Tutorial for Git | http://gitref.org/ |
709+
| Official Git Tutorial | http://git-scm.com/docs/gittutorial |
710+
| Everyday Git | http://git-scm.com/docs/everyday |
711+
| Git Immersion | http://gitimmersion.com/ |
712+
| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html |
713+
| Git for Designer | http://hoth.entp.com/output/git_for_designers.html |
714+
| Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ |
715+
| Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ |
716+
717+
#### Git Books
718+
| Title | Link |
719+
| ----- | ---- |
720+
| Pragmatic Version Control Using Git | http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git |
721+
| Pro Git | http://git-scm.com/book |
722+
| Git Internals Peepcode | http://peepcode.com/products/git-internals-pdf |
723+
| Git in the Trenches | http://cbx33.github.com/gitt/ |
724+
| Version Control with Git | http://www.amazon.com/Version-Control-Git-collaborative-development/dp/1449316387 |
725+
| Pragmatic Guide to Git | http://www.pragprog.com/titles/pg_git/pragmatic-guide-to-git |
726+
| Git: Version Control for Everyone | http://www.packtpub.com/git-version-control-for-everyone/book |

0 commit comments

Comments
 (0)