8000 Merge branch 'master' of https://github.com/tiimgreen/github-cheat-sheet · hail2u/github-cheat-sheet@1333398 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1333398

Browse files
author
Kyo Nagashima
committed
2 parents 4f1ca97 + 7946cd2 commit 1333398

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
## Styling
99

1010
- Use h2 for header:
11-
```markdown
11+
```
1212
## New Feature
1313
```
14+
- Add new feature in Contents Menu in correct position
1415
- Add examples wherever possible
1516
- Use `bash` styling for all git commands:
1617
```bash

README.md

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
# GitHub Cheat Sheet
22

3-
All the hidden and not hidden features of Git and GitHub. This cheat sheet was inspired by Zach Holman's [Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets) talk at Aloha Ruby Conference 2012. Also see Zach's [slides](https://speakerdeck.com/holman/git-and-github-secrets).
3+
All the hidden and not hidden features of Git and GitHub. This cheat sheet was inspired by Zach Holman's [Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets) talk at Aloha Ruby Conference 2012 ([slides](https://speakerdeck.com/holman/git-and-github-secrets)) and his [More Git and GitHub Secrets](https://vimeo.com/72955426) talk at WDCNZ 2013 ([slides](https://speakerdeck.com/holman/more-git-and-github-secrets)).
4+
5+
# Contents
6+
7+
- [Ignore Whitespace](https://github.com/tiimgreen/github-cheat-sheet#ignore-whitespace)
8+
- [Cloning a Repo](https://github.com/tiimgreen/github-cheat-sheet#cloning-a-repo)
9+
- [Hub - Git Wrapper](https://github.com/tiimgreen/github-cheat-sheet#hub---git-wrapper)
10+
- [Previous Branch](https://github.com/tiimgreen/github-cheat-sheet#previous-branch)
11+
- [git.io](https://github.com/tiimgreen/github-cheat-sheet#gitio)
12+
- [Gists](https://github.com/tiimgreen/github-cheat-sheet#gists)
13+
- [Keyboard Shortcuts](https://github.com/tiimgreen/github-cheat-sheet#keyboard-shortcuts)
14+
- [Closing Issues with Commits](https://github.com/tiimgreen/github-cheat-sheet#closing-issues-with-commits)
15+
- [Checking out Pull Requests](https://github.com/tiimgreen/github-cheat-sheet#checking-out-pull-requests)
16+
- [Cross-Link Issues](https://github.com/tiimgreen/github-cheat-sheet#cross-link-issues)
17+
- [Syntax Highlighting in Markdown Files](https://github.com/tiimgreen/github-cheat-sheet#syntax-highlighting-in-markdown-files)
18+
- [Commit History by Author](https://github.com/tiimgreen/github-cheat-sheet#commit-history-by-author)
19+
- [Empty Commits](https://github.com/tiimgreen/github-cheat-sheet#empty-commits)
20+
- [Comparing Branches](https://github.com/tiimgreen/github-cheat-sheet#comparing-branches)
21+
- [Line Highlighting in Repos](https://github.com/tiimgreen/github-cheat-sheet#line-highlighting-in-repos)
22+
- [Emojis](https://github.com/tiimgreen/github-cheat-sheet#emojis)
23+
- [Images/GIFs](https://github.com/tiimgreen/github-cheat-sheet#imagesgifs)
24+
- [Quick Quoting](https://github.com/tiimgreen/github-cheat-sheet#quick-quoting)
25+
- [Styled Git Status](https://github.com/tiimgreen/github-cheat-sheet#styled-git-status)
26+
- [Styled Git Log](https://github.com/tiimgreen/github-cheat-sheet#styled-git-log)
27+
- [Git Query](https://github.com/tiimgreen/github-cheat-sheet#git-query)
28+
- [Merged Branches](https://github.com/tiimgreen/github-cheat-sheet#merged-branches)
29+
- [.gitconfig Recommendations](https://github.com/tiimgreen/github-cheat-sheet#gitconfig-recommendations)
30+
- [Aliases](https://github.com/tiimgreen/github-cheat-sheet#aliases)
31+
- [Auto-correct](https://github.com/tiimgreen/github-cheat-sheet#auto-correct)
32+
- [Color](https://github.com/tiimgreen/github-cheat-sheet#color)
433

534
## Ignore Whitespace
635

@@ -14,7 +43,7 @@ When cloning a repo the `.git` can be left off the edge.
1443
$ git clone https://github.com/tiimgreen/github-cheat-sheet
1544
```
1645

17-
## Hub - Git wrapper
46+
## Hub - Git Wrapper
1847

1948
[Hub](https://github.com/github/hub) is a command line tool that wraps git in order to extend it with extra features and commands that make working with GitHub easier.
2049

@@ -77,9 +106,9 @@ Pressing `s` will select the search bar.
77106

78107
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.
79108

80-
To see all of the shortcuts for given page type `shift+?`
109+
To see all of the shortcuts for the current page type `shift+?`
81110

82-
## Closing issues with commits
111+
## Closing Issues with Commits
83112

84113
If a particular commit fixes an issue, any of the keywords `fix/fixes/fixed` or `close/closes/closed`, followed by the issue number, will close the issue.
85114

@@ -99,7 +128,7 @@ If you want to check out pull request locally, you can fetch it using that comma
99128
$ git fetch origin '+refs/pull/*/head:refs/pull/*'
100129
```
101130

102-
then, checkout pr (i.e. 42) using
131+
then, checkout Pull Request (i.e. 42) using
103132

104133
```bash
105134
$ git checkout refs/pull/42
@@ -111,7 +140,7 @@ Alternatively, you can fetch them as remote branches:
111140
$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'
112141
```
113142

114-
and checkout as
143+
and checkout as:
115144

116145
```bash
117146
$ git checkout origin/pr/42
@@ -133,7 +162,7 @@ and even fetch them automatically, if you add corresponding lines in your .git/c
133162
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
134163
```
135164

136-
## Cross-link issues
165+
## Cross-link Issues
137166

138167
If you want to link to another issue in the same repo, simple type hash `#` then the issue number, it will be auto-linked.
139168

@@ -215,7 +244,7 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L
215244

216245
## Emojis
217246

218-
Emojis can be generated on Pull Requests, Issues, READMEs, etc. using `:name_of_emoji:`
247+
Emojis can be generated on Pull Requests, Issues, Commit Messages, READMEs, etc. using `:name_of_emoji:`
219248

220249
```
221250
:smile:
@@ -229,7 +258,7 @@ Emojis can be generated on Pull Requests, Issues, READMEs, etc. using `:name_of_
229258
:shipit:
230259
:+1:
231260

232-
The full list of supported Emojis on GitHub can be found [here](http://www.emoji-cheat-sheet.com/).
261+
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).
233262

234263
The top 5 used Ejmojis on GitHub are:
235264

@@ -273,6 +302,16 @@ $ git status -sb
273302

274303
![git status -sb](http://i.imgur.com/xNI1bT0.png)
275304

305+
## Styled Git Log
306+
307+
```bash
308+
$ git log --all --graph --decorate --oneline --abbrev-commit
309+
```
310+
311+
![git log --all --graph --decorate --oneline --abbrev-commit](http://i.imgur.com/RUPycwI.png)
312+
313+
NOTE: This can be added into an Alias (shorter command) using the instructions [here](https://github.com/tiimgreen/github-cheat-sheet#aliases)
314+
276315
## Git Query
277316

278317
A git query allows you to search all your previous commit messages and finds the most recent one matching the query.
@@ -283,6 +322,9 @@ $ git show :/query
283322

284323
Where `query` is the term you want to search, this then finds the last one and gives details on the lines that were changed.
285324

325+
```bash
326+
$ git show :/typo
327+
```
286328
![git show :/query](http://i.imgur.com/SA0oZbE.png)
287329

288330
NOTE: Press `q` to quit.

0 commit comments

Comments
 (0)
0