You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-38Lines changed: 46 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -1,64 +1,64 @@
1
1
# GitHub Cheat Sheet
2
2
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)).
3
+
All the hidden and not hidden features of Git and GitHub. This cheat sheet was inspired by [Zach Holman](https://github.com/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)).
[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.
50
+
[Hub](https://github.com/github/hub) is a command line git wrapper that gives extra features and commands that make working with GitHub easier.
51
51
52
52
This allows you to do things like:
53
53
54
54
```bash
55
55
$ hub clone tiimgreen/toc
56
56
```
57
57
58
-
Which translates to:
58
+
instead of:
59
59
60
60
```bash
61
-
$ git clone git://github.com/tiimgreen/toc.git
61
+
$ git clone https://github.com/tiimgreen/toc.git
62
62
```
63
63
64
64
## Previous Branch
@@ -77,6 +77,9 @@ $ git checkout -
77
77
78
78
$ git checkout -
79
79
# Switched to branch 'next'
80
+
81
+
$ git checkout -
82
+
# Switched to branch 'master'
80
83
```
81
84
82
85
## git.io
@@ -108,7 +111,7 @@ Pressing `s` will select the search bar.
108
111
109
112
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.
110
113
111
-
To see all of the shortcuts for the current page type `shift+?`
114
+
To see all of the shortcuts for the current page press `?`.
112
115
113
116
## Closing Issues with Commits
114
117
@@ -122,7 +125,7 @@ This closes the issue and references the closing commit.
122
125
123
126

124
127
125
-
## Checking out pull requests
128
+
## Checking out Pull Requests
126
129
127
130
If you want to check out pull request locally, you can fetch it using that command:
128
131
@@ -234,9 +237,9 @@ which allows you to see the difference on the master branch up a set time ago or
234
237
235
238
## Line Highlighting in Repos
236
239
237
-
Adding `#L52` to the end of a code file URL will highlight that line number.
240
+
Either adding `#L52` to the end of a code file URL or simply clicking the lin number will highlight that line number.
238
241
239
-
It also works with ranges, e.g. `#L53-L60`:
242
+
It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines:
|`git st`|`git status -sb`|`git config --global alias.st 'status -sb'`|
420
424
@@ -451,3 +455,7 @@ To add more colour to your git command line:
451
455
```bash
452
456
$ git config --global color.ui 1
453
457
```
458
+
459
+
# Sharing
460
+
461
+
Share on [Twitter](https://twitter.com/intent/tweet?source=webclient&text=http%3A%2F%2Fgithub.com%2Ftiimgreen%2Fgithub-cheat-sheet%20-%20GitHub%20Cheat%20Sheet)
0 commit comments