https://github.com/tiimgreen/github-cheat-sheet
A list of cool features of Git and GitHub.
https://github.com/tiimgreen/github-cheat-sheet
List: github-cheat-sheet
awesome awesome-list git github list
Last synced: 3 months ago
JSON representation
A list of cool features of Git and GitHub.
- Host: GitHub
- URL: https://github.com/tiimgreen/github-cheat-sheet
- Owner: tiimgreen
- License: mit
- Created: 2014-04-12T16:38:42.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T20:15:56.000Z (over 1 year ago)
- Last Synced: 2024-05-01T21:35:53.194Z (over 1 year ago)
- Topics: awesome, awesome-list, git, github, list
- Homepage: http://git.io/sheet
- Size: 758 KB
- Stars: 45,721
- Watchers: 1,392
- Forks: 5,254
- Open Issues: 36
-
Metadata Files:
- Readme: README.ja.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-cheatsheets - from tiimgreen
- awesome - Cheat Sheet
- more-awesome - Cheat Sheet - A cool features of Git and GitHub. (Programming)
- awesome-projects - Cheat Sheet
- lists - github-cheat-sheet
- awesome-git - GitHub Cheat Sheet
- awesome-collection - GitHub Cheat Sheet
- awesome-awesome - GitHub Cheet Sheet
- awesome-cheatsheet - github-cheat-sheet
- awesome-starred - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- awesome-cn - Cheat Sheet
- collection - github-cheat-sheet
- awesome-possum - Cheat Sheet
- pure-awesomeness - Github Cheat Sheet
- fucking-awesome - Cheat Sheet
- awesomelist - github-cheat-sheet
- awesome-repos - Git and GitHub - cheat-sheet/blob/master/LICENSE) | (Index / CheatSheets)
- awesome-github-star - github-cheat-sheet
- Starred-Repo - Github Cheatsheet
- fucking-lists - github-cheat-sheet
- awesome-links - GitHub Cheat Sheet - A list of cool features of Git and GitHub. (Dev / Git)
- awesome-dendron - GitHub Cheat Sheet - A collection of cool hidden and not so hidden features of Git and GitHub. (Other awesome lists of interest / Web Clippers)
- awesome-cheatsheet - github-cheat-sheet
- awesome - Cheat Sheet
- awesome-digital-marketing - GitHub Cheat Sheet - A collection of cool hidden and not so hidden features of Git and GitHub. (Version Control / URL Shorteners)
- awesome-cpp - github-cheat-sheet - A list of cool features of Git and GitHub. (å ¶å®Awesome项ç®)
- awesome-linux-resources - github-cheat-sheet
- awesome-starred-test - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- awesome-github - GitHub Cheat Sheet - Use this list to test your GitHub knowledge. (Resources for those already familiar with GitHub)
- StarryDivineSky - tiimgreen/github-cheat-sheet
- starred - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- awesome-rainmana - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- awesome - Cheat Sheet
- awesome-learning - tiimgreen/github-cheat-sheet
- awesome-github - Github Cheatsheet
- jimsghstars - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- my-awesome-starred - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- stars - github-cheat-sheet
- Awesome-Web3 - Cheat Sheet
- ultimate-awesome - github-cheat-sheet - A list of cool features of Git and GitHub. (Other Lists / TeX Lists)
- awesome - Cheat Sheet
- awesome-dendron-poc - GitHub Cheat Sheet - A collection of cool hidden and not so hidden features of Git and GitHub. (Other awesome lists of interest / Web Clippers)
- awesome-acs - github-cheat-sheet - A collection of cool hidden and not so hidden features of Git and GitHub. (Useful links / Other awesome 'awesome' list)
- awesome - Cheat Sheet
- awesome-data-analysis - GitHub Cheat Sheet - Git/GitHub workflows and tips. (ð Cheatsheets / Linux & Git)
- awesome-list-for-developers - Cheat Sheet
- awesome-hacking-lists - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- stars - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- awesome - Cheat Sheet
- fintech-awesome-libraries - Github Cheat sheet - A collection of cool hidden and not so hidden features of Git and GitHub. (Cheats sheets)
- awesome-collection - Cheat Sheet
- awesome - Cheat Sheet
- awesome-list - Cheat Sheet
- awesome-cn - Cheat Sheet
- awesome - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- awesome - Cheat Sheet
- web-development-resources - github-cheat-sheet
- awesome-ccamel - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (Misc)
- awesome-git-beginner-resources - Github Cheat Sheet - An awesome list of Git and Github tips. Focuses on obscure and hidden features. (Git Commands and Terminology)
- awesome-cheat-sheets - GitHub Cheat Sheet
- awesome - Cheat Sheet
- starred-awesome - github-cheat-sheet - A list of cool features of Git and GitHub. (Others)
- awesome - tiimgreen/github-cheat-sheet - A list of cool features of Git and GitHub. (miscellaneous)
- awesome-repositories - Git and GitHub - cheat-sheet/blob/master/LICENSE ) | (â¶ïž Content / CheatSheets)
- awesome-software-development-resources - GitHub Cheat Sheet
README
# GitHubã«ã³ãã³ã°ã»ããŒã㌠[](https://github.com/sindresorhus/awesome)
ããã¯GitãGitHubã®é ãããæ©èœãããç¥ãããŠããªãæ©èœã®äžèЧã ã[Zach Holman](https://github.com/holman)ã«ããAloha Ruby Conference 2012ã§ã®[Git and GitHub Secrets](https://github.com/tiimgreen/github-cheat-sheet)ïŒ[ã¹ã©ã€ã](https://github.com/tiimgreen/github-cheat-sheet)ïŒãšWDCNZ 2013ã§ã®[More Git and GitHub Secrets](https://vimeo.com/72955426)ïŒ[ã¹ã©ã€ã](https://speakerdeck.com/holman/more-git-and-github-secrets)ïŒã®äºã€ã®ããŒã¯ãå
ã«ããŠããã
*ççž®URL: [`http://git.io/sheet`](http://git.io/sheet)*
*Read this in other languages: [English](README.md), [íêµìŽ](README.ko.md), [æ¥æ¬èª](README.ja.md), [ç®äœäžæ](README.zh-cn.md), [æ£é«äžæ](README.zh-tw.md).*
# ç®æ¬¡
- [GitHub](#github)
- [空çœã®ç¡èŠ](#%E7%A9%BA%E7%99%BD%E3%81%AE%E7%84%A1%E8%A6%96)
- [ã¿ãå¹
ã®èª¿ç¯](#%E3%82%BF%E3%83%96%E5%B9%85%E3%81%AE%E8%AA%BF%E7%AF%80)
- [ç¹å®ã®ãŠãŒã¶ãŒã«ããã³ãããå±¥æŽ](#%E7%89%B9%E5%AE%9A%E3%81%AE%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AB%E3%82%88%E3%82%8B%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E5%B1%A5%E6%AD%B4)
- [ãªããžããªã®ã¯ããŒã³](#%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%81%AE%E3%82%AF%E3%83%AD%E3%83%BC%E3%83%B3)
- [ãã©ã³ã](#%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81)
- [å
šãã©ã³ããå¥ã®ãã©ã³ããšæ¯èŒ](#%E5%85%A8%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E3%82%92%E5%88%A5%E3%81%AE%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E3%81%A8%E6%AF%94%E8%BC%83)
- [ãã©ã³ãåå£«ã®æ¯èŒ](#%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E5%90%8C%E5%A3%AB%E3%81%AE%E6%AF%94%E8%BC%83)
- [ãã©ãŒã¯ããããªããžããªéã§ã®ãã©ã³ãæ¯èŒ](#%E3%83%95%E3%82%A9%E3%83%BC%E3%82%AF%E3%81%95%E3%82%8C%E3%81%9F%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E9%96%93%E3%81%A7%E3%81%AE%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E6%AF%94%E8%BC%83)
- [Gists](#gists)
- [Git.io](#gitio)
- [ããŒããŒãã»ã·ã§ãŒãã«ãã](#%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88)
- [ã³ãŒãã®æå®è¡ã®åŒ·èª¿](#%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E6%8C%87%E5%AE%9A%E8%A1%8C%E3%81%AE%E5%BC%B7%E8%AA%BF)
- [ã³ãããããissueãéãã](#%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E3%81%8B%E3%82%89issue%E3%82%92%E9%96%89%E3%81%98%E3%82%8B)
- [issueã®çžäºãªã³ã¯](#issue%E3%81%AE%E7%9B%B8%E4%BA%92%E3%83%AA%E3%83%B3%E3%82%AF)
- [ã³ã¡ã³ãã®ããã¯](#%E3%82%B3%E3%83%A1%E3%83%B3%E3%83%88%E3%81%AE%E3%83%AD%E3%83%83%E3%82%AF)
- [pull requestã§ã®CIçµæã®è¡šç€º](#pull-request%E3%81%A7%E3%81%AEci%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA)
- [çµãèŸŒã¿æ€çŽ¢](#%E7%B5%9E%E3%82%8A%E8%BE%BC%E3%81%BF%E6%A4%9C%E7%B4%A2)
- [Markdownãã¡ã€ã«ã§ã®æ§æåŒ·èª¿](#markdown%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A7%E3%81%AE%E6%A7%8B%E6%96%87%E5%BC%B7%E8%AA%BF)
- [Emoji](#emoji)
- [ç»ååã³ã¢ãã¡ãŒã·ã§ã³GIF](#%E7%94%BB%E5%83%8F%E5%8F%8A%E3%81%B3%E3%82%A2%E3%83%8B%E3%83%A1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3gif)
- [GitHub Wikiãžã®ç»åã®æ·»ä»](#github-wiki%E3%81%B8%E3%81%AE%E7%94%BB%E5%83%8F%E3%81%AE%E6%B7%BB%E4%BB%98)
- [çŽ æ©ãåŒçš](#%E7%B4%A0%E6%97%A9%E3%81%8F%E5%BC%95%E7%94%A8)
- [ã³ã¡ã³ããžã®ã¯ãªããããŒãã®ç»åã®è¿œå ](#%E3%82%B3%E3%83%A1%E3%83%B3%E3%83%88%E3%81%B8%E3%81%AE%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AE%E7%94%BB%E5%83%8F%E3%81%AE%E8%BF%BD%E5%8A%A0)
- [èšå®æžã¿ã©ã€ã»ã³ã¹ã®è¿œå ](#%E8%A8%AD%E5%AE%9A%E6%B8%88%E3%81%BF%E3%83%A9%E3%82%A4%E3%82%BB%E3%83%B3%E3%82%B9%E3%81%AE%E8%BF%BD%E5%8A%A0)
- [ã¿ã¹ã¯ãªã¹ã](#%E3%82%BF%E3%82%B9%E3%82%AF%E3%83%AA%E3%82%B9%E3%83%88)
- [Markdownãã¡ã€ã«ã§ã®ã¿ã¹ã¯ãªã¹ã](#markdown%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A7%E3%81%AE%E3%82%BF%E3%82%B9%E3%82%AF%E3%83%AA%E3%82%B9%E3%83%88)
- [çžå¯Ÿãªã³ã¯](#%E7%9B%B8%E5%AF%BE%E3%83%AA%E3%83%B3%E3%82%AF)
- [GitHub Pagesã§ã®ã¡ã¿ããŒã¿ãšãã©ã°ã€ã³ã®ãµããŒã](#github-pages%E3%81%A7%E3%81%AE%E3%83%A1%E3%82%BF%E3%83%87%E3%83%BC%E3%82%BF%E3%81%A8%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%AE%E3%82%B5%E3%83%9D%E3%83%BC%E3%83%88)
- [ææžå
ã®YAMLã¡ã¿ããŒã¿](#%E6%96%87%E6%9B%B8%E5%86%85%E3%81%AEyaml%E3%83%A1%E3%82%BF%E3%83%87%E3%83%BC%E3%82%BF)
- [衚圢åŒã®ããŒã¿è¡šç€º](#%E8%A1%A8%E5%BD%A2%E5%BC%8F%E3%81%AE%E3%83%87%E3%83%BC%E3%82%BF%E8%A1%A8%E7%A4%BA)
- [PDF衚瀺](#pdf%E8%A1%A8%E7%A4%BA)
- [pull requestã®åãæ¶ã](#pull-request%E3%81%AE%E5%8F%96%E3%82%8A%E6%B6%88%E3%81%97)
- [å·®åã®è¡šç€º](#%E5%B7%AE%E5%88%86%E3%81%AE%E8%A1%A8%E7%A4%BA)
- [ã¬ã³ããªã³ã°æžã¿ã®å·®å衚瀺](#%E3%83%AC%E3%83%B3%E3%83%80%E3%83%AA%E3%83%B3%E3%82%B0%E6%B8%88%E3%81%BF%E3%81%AE%E5%B7%AE%E5%88%86%E8%A1%A8%E7%A4%BA)
- [ãããå·®åã®å¯èŠå](#%E3%83%9E%E3%83%83%E3%83%97%E5%B7%AE%E5%88%86%E3%81%AE%E5%8F%AF%E8%A6%96%E5%8C%96)
- [å·®å衚瀺ã®ååŸã衚瀺](#%E5%B7%AE%E5%88%86%E8%A1%A8%E7%A4%BA%E3%81%AE%E5%89%8D%E5%BE%8C%E3%82%92%E8%A1%A8%E7%A4%BA)
- [pull requestã®å
容ãDIFFãŸãã¯PATCH圢åŒã§ååŸ](#pull-request%E3%81%AE%E5%86%85%E5%AE%B9%E3%82%92diff%E3%81%BE%E3%81%9F%E3%81%AFpatch%E5%BD%A2%E5%BC%8F%E3%81%A7%E5%8F%96%E5%BE%97)
- [ç»åã®è¡šç€ºãšDIFF](#%E7%94%BB%E5%83%8F%E3%81%AE%E8%A1%A8%E7%A4%BA%E3%81%A8diff)
- [Hub](#hub)
- [éçºåå ã®ã¬ã€ãã©ã€ã³](#%E9%96%8B%E7%99%BA%E5%8F%82%E5%8A%A0%E3%81%AE%E3%82%AC%E3%82%A4%E3%83%89%E3%83%A9%E3%82%A4%E3%83%B3)
- [Octicons](#octicons)
- [GitHubæ
å ±](#github%E6%83%85%E5%A0%B1)
- [GitHub Talks](#github-talks)
- [Git](#git)
- [ãã¹ãŠã®å逿žã¿ãã¡ã€ã«ãã¯ãŒãã³ã°ã»ããªãŒããåé€ãã](#%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E5%89%8A%E9%99%A4%E6%B8%88%E3%81%BF%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E3%83%AF%E3%83%BC%E3%82%AD%E3%83%B3%E3%82%B0%E3%83%84%E3%83%AA%E3%83%BC%E3%81%8B%E3%82%89%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8B)
- [çŽåã®ãã©ã³ã](#%E7%9B%B4%E5%89%8D%E3%81%AE%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81)
- [空çœã®åé€](#%E7%A9%BA%E7%99%BD%E3%81%AE%E5%89%8A%E9%99%A4)
- [SSHå
¬ééµ](#ssh%E5%85%AC%E9%96%8B%E9%8D%B5)
- [pull requestã®ãã§ãã¯ã¢ãŠã](#pull-request%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%A2%E3%82%A6%E3%83%88)
- [空ã®ã³ããã](#%E7%A9%BA%E3%81%AE%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88)
- [Gitã¹ããŒã¿ã¹ã®ã¹ã¿ã€ãªã³ã°](#git%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%E3%81%AE%E3%82%B9%E3%82%BF%E3%82%A4%E3%83%AA%E3%83%B3%E3%82%B0)
- [Gitãã°ã®ã¹ã¿ã€ãªã³ã°](#git%E3%83%AD%E3%82%B0%E3%81%AE%E3%82%B9%E3%82%BF%E3%82%A4%E3%83%AA%E3%83%B3%E3%82%B0)
- [ã³ããããã°ã®æ€çŽ¢](#%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E3%83%AD%E3%82%B0%E3%81%AE%E6%A4%9C%E7%B4%A2)
- [Git Grep](#git-grep)
- [ããŒãžæžã¿ãã©ã³ã](#%E3%83%9E%E3%83%BC%E3%82%B8%E6%B8%88%E3%81%BF%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81)
- [FixupãšAutosquash](#fixup%E3%81%A8autosquash)
- [ããŒã«ã«ã»ãªããžããªãåç
§ãããŠã§ããµãŒããŒ](#%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%E3%82%92%E5%8F%82%E7%85%A7%E3%81%99%E3%82%8B%E3%82%A6%E3%82%A7%E3%83%96%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC)
- [Gitã®èšå®](#git%E3%81%AE%E8%A8%AD%E5%AE%9A)
- [ãšã€ãªã¢ã¹](#%E3%82%A8%E3%82%A4%E3%83%AA%E3%82%A2%E3%82%B9)
- [ã³ãã³ãã®èªåä¿®æ£](#%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%AE%E8%87%AA%E5%8B%95%E4%BF%AE%E6%AD%A3)
- [è²èšå®](#%E8%89%B2%E8%A8%AD%E5%AE%9A)
- [Gitæ
å ±](#git%E6%83%85%E5%A0%B1)
- [Git Books](#git-books)
- [蚳泚](#%E8%A8%B3%E6%B3%A8)
## GitHub
### 空çœã®ç¡èŠ
GitHubäžã§å·®åããŒãžã衚瀺ããŠããæããã®URLã«`?w=1`ãå ãããšã空çœã®å€åã«ããã§ããå·®åã¯è¡šç€ºãããªããªããã³ãŒãäžã®å€åã ããåç
§ããããšãã§ããã

[*GitHubã®ç§å¯ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/967-github-secrets)
### ã¿ãå¹
ã®èª¿ç¯
å·®åããã¡ã€ã«ã衚瀺ããŠããæãURLã«`?ts=4`ã远å ãããšã¿ãã空çœ4ã€ã®å¹
ã§è¡šç€ºãããããã©ã«ãã¯8ã€ã ã`ts`ã«æå®ããæ°ã§è¡šç€ºããããšããããšã ãããã¯Gistãrawãã¡ã€ã«ã衚瀺ããŠããæã«ã¯é©çšãããªããã[Chrome](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)ãã€ã³ã¹ããŒã«ããããšã«ããã察å¿ããããšãã§ããã
äŸãã°Goã®ãœãŒã¹ãã¡ã€ã«ã衚瀺ããŠããæã`?ts=4`ã远å ããåã¯ãã®ããã«è¡šç€ºãããã:

`?ts=4`ã远å ãããšãã®ããã«è¡šç€ºããã:

### ç¹å®ã®ãŠãŒã¶ãŒã«ããã³ãããå±¥æŽ
ç¹å®ã®ãŠãŒã¶ãŒã«ãããããªããžããªãžã®ã³ãããå±¥æŽã®ã¿ãåç
§ãããå Žåã¯ã`?author={user}`ãURLã®æ«å°Ÿã«ä»ããã
```
https://github.com/rails/rails/commits/master?author=dhh
```

[*ã³ãããã»ãã¥ãŒã®éãã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/differences-between-commit-views)
### ãªããžããªã®ã¯ããŒã³
ãªããžããªãã¯ããŒã³ããæãURLã®æ«å°Ÿã®`.git`ã¯ç¡ããŠãæ§ããªãã
```bash
$ git clone https://github.com/tiimgreen/github-cheat-sheet
```
[*Gitã®`clone`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-clone)
### ãã©ã³ã
#### å
šãã©ã³ããå¥ã®ãã©ã³ããšæ¯èŒ
ã³ãããäžèЧãã¿ã³ã®é£ãã[ãã©ã³ãäžèЧ](https://github.com/tiimgreen/github-cheat-sheet/branches)ããŒãžã«è¡ããš:
```
https://github.com/{user}/{repo}/branches
```
ã¡ã€ã³ã»ãã©ã³ãã«ããŒãžãããŠããªããã©ã³ãã®äžèЧã衚瀺ãããã
ãã®ããŒãžãããã¿ã³ãã¯ãªãã¯ããŠãã©ã³ãæ¯èŒããŒãžãžç§»åããããã©ã³ããåé€ããããšãã§ããã

#### ãã©ã³ãåå£«ã®æ¯èŒ
GitHubã®ãã©ã³ãæ¯èŒã¯ä»¥äžã®ãããªURLã§æäŸãããŠãã:
```
https://github.com/{user}/{repo}/compare/{range}
```
`{range}`ã`master...4-1-stable`ã«å€æŽããã
äŸãã°:
```
https://github.com/rails/rails/compare/master...4-1-stable
```

`{range}`ã«ã¯ä»¥äžã®ããã«å€æŽããããšãã§ãã:
```
https://github.com/rails/rails/compare/master@{1.day.ago}...master
https://github.com/rails/rails/compare/master@{2014-10-04}...master
```
*æ¥ä»ã®åœ¢åŒã¯`YYYY-MM-DD`ã ã*

`diff`ã`patch`ã®ãã¥ãŒã§ããã©ã³ããå©çšããŠæ¯èŒããããšãã§ãã:
```
https://github.com/rails/rails/compare/master...4-1-stable.diff
https://github.com/rails/rails/compare/master...4-1-stable.patch
```
[*æéãæå®ããŠã®ãã©ã³ãæ¯èŒã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/comparing-commits-across-time)
#### ãã©ãŒã¯ããããªããžããªéã§ã®ãã©ã³ãæ¯èŒ
GitHubã§ãã©ãŒã¯ããããªããžããªå士ã§ãã©ã³ããæ¯èŒããå Žåã以äžã®ãããªURLã倿Žãã:
```
https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch}
```
äŸ:
```
https://github.com/rails/rails/compare/byroot:master...master
```

### Gists
[Gists](https://gist.github.com/)ã¯å°éã®ã³ãŒã矀ã管çããæé©ãªææ®µã ãã¡ãããšãããªããžããªããã¡ãã¡äœæããå¿
èŠã¯ãªãã

Gistã®URLã®æåŸã«`.pibb`ãä»ãã([äŸ](https://gist.github.com/hail2u/9477708.pibb))ãš*HTMLã®ã¿*ã®ããŒãžã§ã³ã衚瀺ãããã®ã§ããã®ãœãŒã¹ã¯ä»ã®ãŠã§ããµã€ãã«è²Œãä»ããã«ã¯ãã£ãŠããã ããã
ç°¡åãªãã®ãšã¯ãããGitãªããžããªãšããŠæ©èœããããã以äžã®ããã«ããã°æ®éã®Gitãªããžããªãšåãããã«ã¯ããŒã³ããããšãã§ãã:
```bash
$ git clone https://gist.github.com/tiimgreen/10545817
```

This means you also can modify and push updates to Gists:
```bash
$ git commit
$ git push
Username for 'https://gist.github.com':
Password for 'https://tiimgreen@gist.github.com':
```
ããããªãããGistã§ã¯ãã£ã¬ã¯ããªãŒããµããŒããããŠããªããå
šãŠã®ãã¡ã€ã«ã¯ãªããžããªãŒã®ã«ãŒãã«çœ®ãããŠããå¿
èŠãããã
[*Gistã®äœæã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/creating-gists)
### Git.io
[Git.io](http://git.io)ã¯GitHubã®æäŸããGitHubå°çšã®ã·ã³ãã«ãªççž®URLãµãŒãã¹ã ã

cURLã䜿ã£ãŠå©çšããããšãã§ãã:
```bash
$ curl -i http://git.io -F "url=https://github.com/..."
HTTP/1.1 201 Created
Location: http://git.io/abc123
$ curl -i http://git.io/abc123
HTTP/1.1 302 Found
Location: https://github.com/...
```
[*Git.ioã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/985-git-io-github-url-shortener)
### ããŒããŒãã»ã·ã§ãŒãã«ãã
ãªããžããªããã©ãŠã¶ãŒã§éããŠããæã¯ãã·ã§ãŒãã«ãããå©çšããŠæ§ã
ãªæ©èœãç°¡åã«ã¢ã¯ã»ã¹ã§ããããã«ãªã£ãŠããã
- `t`ãæŒããšãã¡ã€ã«ã®æ€çŽ¢ã€ã³ã¿ãŒãã§ã€ã¹ãèµ·åããã
- `w`ãæŒããšãã©ã³ãéžæã€ã³ã¿ãŒãã§ã€ã¹ãèµ·åããã
- `s`ãæŒããšçŸåšé²èЧããŠãããªããžããªãŒããæ€çŽ¢ãããã©ãŒã ã«ãã©ãŒã«ã¹ãåœãããããã§BackspaceãæŒããThis repositoryããšããæååãæ¶ãããšã§GitHubå
šäœããã®æ€çŽ¢ãžãšåãæ¿ããããšãã§ãã
- issueç»é¢ã§`l`ãæŒããšã©ãã«ã®ç·šéã€ã³ã¿ãŒãã§ã€ã¹ãéãããã
- __ãã¡ã€ã«ãåç
§ããŠããæ__ïŒäŸ: `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`)ã«`y`ãæŒããšãåç
§ããŠããæã®ç¶æ
ã§åºå®ãããURLã«å€æŽããããã€ãŸããã®ãã¡ã€ã«ã®ã³ãŒããåŸã«å€åãããšããŠãããã®URLã§ã¯ä»ãšãŸã£ããåãç¶æ
ã§è¡šç€ºããããšããããšã ã
`?`ãæŒããšãã®ããŒãžã§äœ¿ããå
šã·ã§ãŒãã«ããã衚瀺ãããã ããã

[*æ€çŽ¢æ©èœã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/search-syntax/)
### ã³ãŒãã®æå®è¡ã®åŒ·èª¿
ã³ãŒãã®URLã®æ«å°Ÿã«`#L52`ãšä»ãããè¡çªå·ãã¯ãªãã¯ãããšããã®è¡ã匷調衚瀺ãããã
ããã¯ç¯å²æå®ãå¯èœã ïŒäŸ: `#L53-L60`ïŒããããã£ãç¯å²ãéžæããã«ã¯`shift`ãæŒããªããäºã€ã®è¡ãã¯ãªãã¯ããŠãè¯ã:
```
https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60
```

### ã³ãããããissueãéãã
ããã³ãããã§issueã解決ããå Žåãã³ãããã¡ãã»ãŒãžã§`fix/fixes/fixed`ã`close/closes/closed`ã`resolve/resolves/resolved`ã«ç¶ããŠissueçªå·ãæå®ãããšããã®ã³ããããmasterãã©ã³ãã«pushããããšåæã«æå®issueãéããããã ããã
```bash
$ git commit -m "Fix screwup, fixes #12"
```
ãããããšissue#12ãéããããéããissueã«ã¯ãã®ã³ããããžã®åç
§ãèªåçã«è¿œå ãããã

[*ã³ãããã»ã¡ãã»ãŒãžããissueãéããæ¹æ³ã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/closing-issues-via-commit-messages)
### issueã®çžäºãªã³ã¯
åããªããžããªã®éãissueãžãªã³ã¯ã匵ãåç
§ããããå Žåã`#`ã«ç¶ããŠissueçªå·ãæå®ããããããããšèªåçã«ãªã³ã¯ãäœæãããã ããã
å¥ã®ãªããžããªã®issueã®å Žåã¯`{user}/{repo}#ISSUE_NUMBER`ãšããã°è¯ãïŒäŸ: `tiimgreen/toc#12`ïŒã

### ã³ã¡ã³ãã®ããã¯
ãªããžããªã®ãªãŒããŒãå
±åéçºè
ãªãã°ãpull requestãissueãžã®ã³ã¡ã³ããããã¯ã§ããããã«ãªã£ãã

ã€ãŸããã®ãããžã§ã¯ãã®å
±åéçºè
ã§ã¯ãªããŠãŒã¶ãŒã¯ã³ã¡ã³ããããããšãã§ããªããšããããšã ã

[*ã³ã¡ã³ãã®ããã¯ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1847-locking-conversations)
### pull requestã§ã®CIçµæã®è¡šç€º
é©åã«èšå®ãè¡ãã°pull requestãåãåããã³ã«ãéåžžã®ã³ããããšåãããã«[Travis CI](https://travis-ci.org/)ããã®pull requestããã«ãããã ãããã©ãèšå®ãããã¯[Travis CI: Getting started](http://docs.travis-ci.com/user/getting-started/)ãèªããšè¯ãã
[](https://github.com/octokit/octokit.rb/pull/452)
[*ã³ãããã»ã¹ããŒã¿ã¹APIã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1227-commit-status-api)
### çµãèŸŒã¿æ€çŽ¢
issueãšpull requestã®æ€çŽ¢ã€ã³ã¿ãŒãã§ã€ã¹ã§ã¯ãçµã蟌ã¿ããããããšãå¯èœã ã
äŸãã°[Railsã®ãªããžããªãŒ](https://github.com/rails/rails/issues)ã§ã¯ã以äžã®æ§ãªçµãèŸŒã¿æ€çŽ¢ã«ãã"activerecord"ãšããã©ãã«ãã€ããissueã®ã¿ã衚瀺ããããšãã§ãã:
`is:issue label:activerecord`
éã«"activerecord"ãšããã©ãã«ã*ã€ããŠããªã*issueã®ã¿ã衚瀺ããããšãã§ãã:
`is:issue -label:activerecord`
ãããŠããã®çµãèŸŒã¿æ€çŽ¢ã¯pull requestã«å¯ŸããŠãè¡ãããšãã§ãã:
`is:pr -label:activerecord`
GitHubã§ã¯éãããŠããissueãpull requestã®ã¿ã衚瀺ããã¿ãããŸãã¯æ¢ã«éãããããããã®ã¿ã衚瀺ããã¿ããçšæãããŠããããçµãèŸŒã¿æ€çŽ¢ã«ãã£ãŠããŒãžæžã¿ã®pull requestã®ã¿ã衚瀺ããããšãã§ããã以äžã®ãããªãã£ã«ã¿ãŒã䜿ãã°è¯ãã ãã:
`is:merged`
[*issueã®æ€çŽ¢ã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/searching-issues)
ãããŠGitHubã¯Status APIã®çµæã䜿ã£ãŠãã£ã«ã¿ãŒããããšãã§ããããã«ãªã£ãã
Status APIã§successãèšå®ãããpull requestã®ã¿:
`status:success`
[*Status APIã䜿ã£ãçµãèŸŒã¿æ€çŽ¢ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/2014-filter-pull-requests-by-status)
### Markdownãã¡ã€ã«ã§ã®æ§æåŒ·èª¿
äŸãã°Markdownãã¡ã€ã«ã§Rubyã®ã³ãŒããæ§æåŒ·èª¿ããããªãã°ä»¥äžã®ããã«ãã:
```ruby
require 'tabbit'
table = Tabbit.new('Name', 'Email')
table.add_row('Tim Green', 'tiimgreen@gmail.com')
puts table.to_s
```
ãããããšä»¥äžã®ããã«è¡šç€ºãããããšã«ãªã:
```ruby
require 'tabbit'
table = Tabbit.new('Name', 'Email')
table.add_row('Tim Green', 'tiimgreen@gmail.com')
puts table.to_s
```
GitHubã§ã¯[Linguist](https://github.com/github/linguist)ã䜿ã£ãŠèšèªãå€å¥ãæ§æåŒ·èª¿ãè¡ã£ãŠãããæ§æåŒ·èª¿ããµããŒããããŠããèšèªã®äžèЧã¯[èšèªå®çŸ©YAMLãã¡ã€ã«](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)ãåç
§ããã°ãããã ããã
[*GitHub Flavored Markdownã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/github-flavored-markdown)
### Emoji
Emojiã¯pull requestãissueãã³ãããã»ã¡ãã»ãŒãžããªããžããªãŒã®æŠèŠãªã©ã§`:name_of_emoji:`ãšæžããšå©çšã§ãã:
GitHubã§ãµããŒããããŠããEmojiã®å®å
šãªãªã¹ãã¯[Emoji cheat sheet for Campfire and GitHub](http://www.emoji-cheat-sheet.com/)ã[All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)ã§ç¢ºèªã§ããã
çŽ æµãªemojiã®æ€çŽ¢ã¯[emoji.muan.co](http://emoji.muan.co/)ã
GitHubã§äœ¿ãããŠããEmojiã®ããã5ã¯ä»¥äžã®éãã :
1. `:shipit:`
2. `:sparkles:`
3. `:-1:`
4. `:+1:`
5. `:clap:`
### ç»ååã³ã¢ãã¡ãŒã·ã§ã³GIF
ç»åãã¢ãã¡ãŒã·ã§ã³GIFã¯ã³ãããã®ã³ã¡ã³ããREADMEãªã©ã§å©çšã§ãã:
```

```
ãªããžããªã«ããç»åãçŽæ¥åç
§ããããšãåºæ¥ã:
```

```

ããããç»åã¯GitHubã§ãã£ãã·ã¥ãããã®ã§ãç»åã®ãã¹ãã£ã³ã°å
ãèœã¡ãŠãããšããŠãå€ããã衚瀺ãããã ããã
#### GitHub Wikiãžã®ç»åã®æ·»ä»
GitHub Wikiã§ç»åã远å ããæ¹æ³ãããã€ããããéåžžã®Markdownèšæ³ïŒåç¯ãåç
§ïŒã¯ãã¡ãã䜿ããããããããã ãã§ã¯ãªããç»åã®å¹
ãšé«ããæå®ããèšæ³ã䜿ãããšãã§ãã:
```markdown
[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]]
```
ãããããšä»¥äžã®ããã«ãªã:

### çŽ æ©ãåŒçš
issueã®ã¹ã¬ããã§ä»ã®äººã®ã³ã¡ã³ããåŒçšããŠã³ã¡ã³ããããå ŽåãåŒçšãããæç« ãéžæããç¶æ
ã§`r`ãæŒããšããããã¯åŒçšã®èšæ³ã䜿ã£ãŠããã¹ããšãªã¢ã«ã³ããŒãããã

[*çŽ æ©ãåŒçšããæ¹æ³ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1399-quick-quotes)
### ã³ã¡ã³ããžã®ã¯ãªããããŒãã®ç»åã®è¿œå
_(Chromeç³»ã®ãã©ãŠã¶ãŒã®ã¿ã§åäœ)_
ã¹ã¯ãªãŒã³ã·ã§ãããã¯ãªããããŒãã«ä¿å(mac: `cmd-ctrl-shift-4`)ããåŸããã®ç»åã¯ã³ã¡ã³ãæçš¿ãã©ãŒã ã§è²Œãä»ã(`cmd-v`ãŸãã¯`ctrl-v`)ãããšãã§ããèªåçã«GitHubãžã¢ããããŒããããŸãã

[*ã³ã¡ã³ããžã®ã¯ãªããããŒãã®ç»åã®è¿œå ã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/issue-attachments)
### èšå®æžã¿ã©ã€ã»ã³ã¹ã®è¿œå
GitHubäžã§ãªããžããªãäœæããæããããããèšå®ãããŠããã©ã€ã»ã³ã¹ã远å ããããšãã§ãã:

æ¢ã«ååšãããªããžããªã§ãã£ãŠããŠã§ãäžã®ã€ã³ã¿ãŒãã§ã€ã¹ãããã¡ã€ã«ãäœæããããšã§è¿œå ã§ããã`LICENSE`ãšãããã¡ã€ã«åã«ããå Žåãã©ã€ã»ã³ã¹ãéžæãããªãã·ã§ã³ã衚瀺ãããã®ã :

`.gitignore`ãåãããã«äœææã«è¿œå ããããšããåŸã§è¿œå ããããšãã§ããã
[*ãªãŒãã³ãœãŒã¹ã»ã©ã€ã»ã³ã¹ã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/open-source-licensing)
### ã¿ã¹ã¯ãªã¹ã
issueãpull requestã§ã¯ä»¥äžã®ããã«ïŒç©ºçœã«æ³šæïŒæžããšãã§ãã¯ããã¯ã¹ãäœæããããšãã§ãã:
```
- [ ] Be awesome
- [ ] Prepare dinner
- [ ] Research recipe
- [ ] Buy ingredients
- [ ] Cook recipe
- [ ] Sleep
```

ããããã§ãã¯ããã¯ã¹ã«ãã§ãã¯ãå
¥ãããããšãåæã«MarkdownãœãŒã¹ãæŽæ°ããã:
```
- [x] Be awesome
- [ ] Prepare dinner
- [x] Research recipe
- [x] Buy ingredients
- [ ] Cook recipe
- [ ] Sleep
```
[*ã¿ã¹ã¯ã»ãªã¹ãã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/writing-on-github#task-lists)
#### Markdownãã¡ã€ã«ã§ã®ã¿ã¹ã¯ãªã¹ã
éåžžã®Markdownãã¡ã€ã«ã§ã**èªã¿åãå°çš**ã®ãã§ãã¯ãªã¹ãã以äžã®ãããªèšæ³ã§è¿œå ããããšãã§ãã:
```
- [ ] Mercury
- [x] Venus
- [x] Earth
- [x] Mars
- [ ] Jupiter
```
- [ ] Mercury
- [x] Venus
- [x] Earth
- [x] Mars
- [ ] Jupiter
[*Markdownãã¡ã€ã«ã§ã®ã¿ã¹ã¯ãªã¹ãã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1825-task-lists-in-all-markdown-documents)
### çžå¯Ÿãªã³ã¯
Markdownãã¡ã€ã«ã§ãªããžããªå
ã®ã³ã³ãã³ããžåŒµãå Žåãçžå¯Ÿãªã³ã¯ãå©çšããããšãæšå¥šãããŠããã
```markdown
[Link to a header](#awesome-section)
[Link to a file](docs/readme)
```
絶察ãªã³ã¯ã¯URLã®å€æŽïŒäŸ: ãªããžããªã®ãªããŒã ããŠãŒã¶ãŒåã®å€æŽããããžã§ã¯ãã®ãã©ãŒã¯ïŒã«ããæŽæ°ããããçžå¯Ÿãªã³ã¯ãå©çšããã°ããã®ãŸãŸããŸãæ©èœããã¯ãã ã
[*çžå¯Ÿãªã³ã¯ã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/relative-links-in-readmes)
### GitHub Pagesã§ã®ã¡ã¿ããŒã¿ãšãã©ã°ã€ã³ã®ãµããŒã
Jekyllã®ããŒãžãæçš¿ã§ã¯ãªããžããªã®æ
å ±ã`site.github`ãšããåå空éã«æ ŒçŽãããŠãããäŸãã°`{{ site.github.project_title }}`ãªã©ãšæžãã°è¡šç€ºããããšãã§ããã
ãŸããJemojiãšjekyll-mentionsãšãããã©ã°ã€ã³ãã€ã³ã¹ããŒã«ãããŠããã®ã§ã[Emoji](#emoji)ã[@mentions](https://github.com/blog/821)ã¯Jekyllã®æçš¿ãããŒãžã§GitHub.comäžãšåãããã«åäœããã
[*GitHub Pageã§ã®ã¡ã¿ããŒã¿ãšãã©ã°ã€ã³ã®ãµããŒãã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages)
### ææžå
ã®YAMLã¡ã¿ããŒã¿
[Jekyll](http://jekyllrb.com/)ã[GitHub Pages](http://pages.github.com/)ã§å©çšããŠããå Žåãªã©ãå€ãã®ããã°ã§ã¯YAML圢åŒã®ã¡ã¿ããŒã¿ããã®èšäºã®å
é ã«æžãå¿
èŠããããGitHubã§ã¯ãããã£ãã¡ã¿ããŒã¿ãèªã¿ãããããã«è¡šãšããŠè¡šç€ºããŠããã:

[*ææžå
ã®YAMLã¡ã¿ããŒã¿ã®è¡šç€ºã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents)
### 衚圢åŒã®ããŒã¿è¡šç€º
GitHubã§ã¯`.csv`ïŒã«ã³ãåºåãïŒãš`.tsv`ïŒã¿ãåºåãïŒã®åœ¢åŒã§æžãããè¡šãæŽåœ¢ããŠè¡šç€ºããæ©èœããµããŒãããŠããã

[*衚圢åŒã®ããŒã¿è¡šç€ºã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1601-see-your-csvs)
### PDF衚瀺
GitHubã§ã¯PDFã®è¡šç€ºããµããŒãããŠãã:

[*PDF衚瀺ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1974-pdf-viewing)
### pull requestã®åãæ¶ã
pull requestãããŒãžããåŸãæå³ããªãã£ãããšãããã£ããããã®pull requestãããŒãžããã®ã¯ééãã ã£ãããšããããããšãããã ããã
ãã®åãæ¶ãã¯ãpull requestã®ããŒãžã«è¡šç€ºãããŠããããŒãžã»ã³ãããã®å³ç«¯ã«ãã**Revert**ãã¿ã³ãã¯ãªãã¯ããããšã«ããããã®pull requestã§è¡ããã倿Žãåãæ¶ãpull requestãäœæããããšã«ãã£ãŠè¡ãããšãã§ããã

[*pull requestã®åãæ¶ãã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1857-introducing-the-revert-button)
### å·®åã®è¡šç€º
#### ã¬ã³ããªã³ã°æžã¿ã®å·®å衚瀺
ã³ããããpull requestã«GitHubã§ã¬ã³ããªã³ã°ãããŠè¡šç€ºããããã®ïŒäŸ: MarkdownïŒãå«ãŸããå Žåããã®*ãœãŒã¹*ãš*ã¬ã³ããªã³ã°æžã¿*ã®äž¡æ¹ã®å·®åãèŠãããšãã§ããã

ã¬ã³ããªã³ã°ãããç¶æ
ã§ã®å·®åã衚瀺ãããå Žåã¯ãRenderedããã¿ã³ãã¯ãªãã¯ãããã¬ã³ããªã³ã°æžã¿ã®å·®å衚瀺ã§ã¯æç« ã®è¿œå ãåé€ãç·šéããããããããã:

[*ã¬ã³ããªã³ã°æžã¿ã®å·®å衚瀺ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1784-rendered-prose-diffs)
#### ãããå·®åã®å¯èŠå
ã³ããããpull requestã«ãžãªããŒã¿ã®å€æŽãå«ãŸããŠããå Žåã¯ãã€ããGitHubã§ã¯ãã®ãžãªããŒã¿ã®å€åãå¯èŠåããŠãããã ããã
[](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5)
[*ãããå·®åã®å¯èŠåã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1772-diffable-more-customizable-maps)
#### å·®å衚瀺ã®ååŸã衚瀺
å·®å衚瀺ã®è¡çªå·ä»è¿ã«ãã*å±é*ãã¿ã³ã䜿ããšããã®ååŸã®è¡ãã¯ãªãã¯ããŠè¡šç€ºãããããšãã§ããã*å±é*ãã¿ã³ãæŒãç¶ããããšã«ãã£ãŠãã¡ã€ã«å
šäœã衚瀺ããããšãã§ãããããŸããã®æ©èœã¯ããããGitHubã®å·®å衚瀺ãã¥ãŒã«çšæãããŠããã

[*å·®å衚瀺ã®ååŸã衚瀺ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1705-expanding-context-in-diffs)
#### pull requestã®å
容ãDIFFãŸãã¯PATCH圢åŒã§ååŸ
pull requestã«ããå·®åã¯ãã®URLã®æ«å°Ÿã«`.diff`ãŸãã¯`.patch`ã远å ãããšãããããã®åœ¢åŒã§ååŸããããšãã§ãããäŸãã°:
```
https://github.com/tiimgreen/github-cheat-sheet/pull/15
https://github.com/tiimgreen/github-cheat-sheet/pull/15.diff
https://github.com/tiimgreen/github-cheat-sheet/pull/15.patch
```
æ¡åŒµå`.diff`ã远å ããå Žåããã®ãããªãã¬ãŒã³ããã¹ãã§è¡šç€ºãããã ãã:
```
diff --git a/README.md b/README.md
index 88fcf69..8614873 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i
- [Merged Branches](#merged-branches)
- [Quick Licensing](#quick-licensing)
- [TODO Lists](#todo-lists)
+- [Relative Links](#relative-links)
- [.gitconfig Recommendations](#gitconfig-recommendations)
- [Aliases](#aliases)
- [Auto-correct](#auto-correct)
@@ -381,6 +382,19 @@ When they are clicked, they will be updated in the pure Markdown:
- [ ] Sleep
(...)
```
#### ç»åã®è¡šç€ºãšDIFF
GitHubã¯ãPNGãJPGãGIFãPSDãšãã£ãå€ãã®äžè¬çãªç»å圢åŒã®è¡šç€ºããµããŒãããŠãããããã«å ããæ§ã
ãªæ¹æ³ã§ãããç»å圢åŒã®ããŒãžã§ã³ããšã®å·®åãæ¯èŒããããšãã§ããã
[](https://github.com/blog/1845-psd-viewing-diffing)
[*ç»åã®è¡šç€ºãšDIFFã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/rendering-and-diffing-images)
### Hub
[Hub](https://github.com/github/hub)ã¯Gitã®ã©ãããŒãšããŠæ©èœããã³ãã³ãã©ã€ã³ã»ããŒã«ã§ããããå©çšãããšGitHubãã³ãã³ãã©ã€ã³ãããšãŠãç°¡åã«æ±ããããã«ãªãã
äŸãã°ä»¥äžã®ããã«ããŠãªããžããªã®ã¯ããŒã³ãè¡ãã:
```bash
$ hub clone tiimgreen/toc
```
ããã以äžã®ã³ãã³ãã®ä»£ãããšããããã :
```bash
$ git clone https://github.com/tiimgreen/toc.git
```
[*HubãæäŸãã䟿å©ãªæ©èœã«ã€ããŠãã£ãšè©³ãã*](https://github.com/github/hub#commands)
### éçºåå ã®ã¬ã€ãã©ã€ã³
ãªããžããªã®ã«ãŒãã«`CONTRIBUTING`ãšããååã®ãã¡ã€ã«ã眮ããšãissueãpull requestãäœæããããšããæã«ãããžã®ãªã³ã¯ã衚瀺ãããããã«ãªãã

[*éçºåå ã®ã¬ã€ãã©ã€ã³ã«ã€ããŠãã£ãšè©³ãã*](https://github.com/blog/1184-contributing-guidelines)
### Octicons
GitHubã§äœ¿ãããŠããã¢ã€ã³ã³ïŒOcticonsïŒã¯ãªãŒãã³ãœãŒã¹åãããã

[*GitHubã®Octiconsã«ã€ããŠãã£ãšè©³ãã*](https://octicons.github.com)
### GitHubæ
å ±
| Title | Link |
| ----- | ---- |
| GitHub Explore | https://github.com/explore |
| GitHub Blog | https://github.com/blog |
| GitHub Help | https://help.github.com/ |
| GitHub Training | http://training.github.com/ |
| GitHub Developer | https://developer.github.com/ |
#### GitHub Talks
| Title | Link |
| ----- | ---- |
| How GitHub Uses GitHub to Build GitHub | https://www.youtube.com/watch?v=qyz3jkOBbQY |
| Introduction to Git with Scott Chacon of GitHub | https://www.youtube.com/watch?v=ZDR433b0HJY |
| How GitHub No Longer Works | https://www.youtube.com/watch?v=gXD1ITW7iZI |
| Git and GitHub Secrets | https://www.youtube.com/watch?v=Foz9yvMkvlA |
| More Git and GitHub Secrets | https://www.youtube.com/watch?v=p50xsL-iVgU |
## Git
### ãã¹ãŠã®å逿žã¿ãã¡ã€ã«ãã¯ãŒãã³ã°ã»ããªãŒããåé€ãã
äŸãã°`/bin/rm`ã䜿ã£ãŠå€§éã®ãã¡ã€ã«ãåé€ããå Žåã以äžã®ã³ãã³ãã䜿ãã°ã¯ãŒãã³ã°ã»ããªãŒããããŠã€ã³ããã¯ã¹ãããåé€ããããšãã§ãããã¡ã€ã«ããšã«ããããGitã³ãã³ããå®è¡ããå¿
èŠããªããªã:
```bash
$ git rm $(git ls-files -d)
```
äŸãã°ä»¥äžã®ããã«å®è¡ããã:
```bash
$ git status
On branch master
Changes not staged for commit:
deleted: a
deleted: c
$ git rm $(git ls-files -d)
rm 'a'
rm 'c'
$ git status
On branch master
Changes to be committed:
deleted: a
deleted: c
```
### çŽåã®ãã©ã³ã
Gitã§çŽåã®ãã©ã³ããžç§»åããã«ã¯:
```bash
$ git checkout -
# Switched to branch 'master'
$ git checkout -
# Switched to branch 'next'
$ git checkout -
# Switched to branch 'master'
```
[*Gitã®ãã©ã³ãæäœã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging)
### 空çœã®åé€
Gitã®`stripspace`ã³ãã³ãã¯ä»¥äžã®äœæ¥ãè¡ã:
- è¡æ«ã®ç©ºçœæåã®åé€
- 空çœè¡ã®åããŸãšã
- ãã¡ã€ã«æ«å°Ÿãžã®æ¹è¡ã®è¿œå
ãã®ã³ãã³ããåŒã¶æã¯ãã¡ã€ã«ãæž¡ããã°ãªããªããäŸ:
```bash
$ git stripspace < README.md
```
[*Gitã®`stripspace`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-stripspace)
### SSHå
¬ééµ
以äžã®URLã«ã¢ã¯ã»ã¹ããããšã§ãSSHå
¬ééµã®äžèЧãããã¹ã圢åŒã§ååŸããããšãã§ãã:
```
https://github.com/{user}.keys
```
äŸ: [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys)
[*SSHå
¬ééµã«ã€ããŠãã£ãšè©³ãã*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/)
### pull requestã®ãã§ãã¯ã¢ãŠã
pull requestã¯GitHubã®ãªããžããªã§ã¯ç¹å¥ãªãã©ã³ãã§ãããæ§ã
ãªæ¹æ³ã§ããŒã«ã«ã«åã蟌ãããšãã§ãã:
ç¹å®ã®pull requestãåã蟌ã¿ãäžæçã«`FETCH_HEAD`ãšããŠä¿åãããšãçŽ æ©ãå·®åã確èªããŠããŒãžããããšãå¯èœã :
```bash
$ git fetch origin refs/pull/[PR-Number]/head
```
åç
§ä»æ§ã䜿ããšãã¹ãŠã®pull requestãããŒã«ã«ã»ãã©ã³ããšããŠåã蟌ãããšãã§ãã:
```bash
$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'
```
ãªããžããªã®`.git/config`ã«ä»¥äžã®è¡ã远å ããã°èªåçã«pull requestãèœãšãããã«ãã§ããã ãã:
```
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:tiimgreen/github-cheat-sheet.git
```
```
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:tiimgreen/github-cheat-sheet.git
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
```
ãã©ãŒã¯ãããŠããéãããŠããpull requestã«å¯ŸããŠã¯ããã®pull requestãåç
§ãããªã¢ãŒãã»ãã©ã³ãããçŽæ¥ããŒã«ã«ã»ãã©ã³ããšããŠãã§ãã¯ã¢ãŠããããšäŸ¿å©ã ãã:
```bash
$ git checkout pr/42 pr-42
```
ãããã¯æ§ã
ãªãªããžããªã§äœæ¥ãããã®ãªãã代ããã«ã°ããŒãã«ã®Gitèšå®ã§è¡ãããšã«ãããpull requestã®ååŸãã°ããŒãã«ã«èšå®ãããšè¯ãã ããã
```bash
git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
```
ãããããšä»¥äžã®æ§ãªçãã³ãã³ããå©çšããããšãå¯èœã«ãªã:
```bash
git fetch origin
```
```bash
git checkout pr/42
```
[*pull requestã®ãã§ãã¯ã¢ãŠãã«ã€ããŠãã£ãšè©³ãã*](https://help.github.com/articles/checking-out-pull-requests-locally)
### 空ã®ã³ããã
`--allow-empty`ãªãã·ã§ã³ãä»ãããšãã³ãŒãã®å€åããªããŠãã³ããããäœæããããšãã§ãã:
```bash
$ git commit -m "Big-ass commit" --allow-empty
```
ãã®æ©èœã®äœ¿ãæ¹ïŒäŸ¿å©ãªãã®ïŒãšããŠã¯ä»¥äžã®ãããªãã®ãæãããã:
- æ°ããªæ©èœã倧ããªå€æŽãäºåã«éç¥ããæ
- ã³ãŒãäžã«çŸããªããããªå€æŽããããžã§ã¯ãã«å ããæ
- ãªããžããªãå©çšããŠèª°ããšé£çµ¡ãåãããæ
- ãªããžããªãžã®æåã®ã³ããããããçŽãã§ããããã«ãããæ: `git commit -m "init repo" --allow-empty`.
### Gitã¹ããŒã¿ã¹ã®ã¹ã¿ã€ãªã³ã°
æ®éã«å®è¡ãããš:
```bash
$ git status
```
ãã®ããã«è¡šç€ºãããã:

`-sb`ã远å ããããšã«ãã£ãŠ:
```bash
$ git status -sb
```
ãã®ããã«è¡šç€ºããããšãã§ãã:

[*Gitã®`status`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-status)
### Gitãã°ã®ã¹ã¿ã€ãªã³ã°
以äžã®ããã«å®è¡ãããš:
```bash
$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
```
ãã®ããã«è¡šç€ºããã:

ãã®èšå®ã¯[Palesz](http://stackoverflow.com/users/88355/palesz)ãèãããã®ã ã
*ããã¯[åŸè¿°ã®æé ](#%E3%82%A8%E3%82%A4%E3%83%AA%E3%82%A2%E3%82%B9)ã«åŸã£ãŠãšã€ãªã¢ã¹ãžè¿œå ããããšãã§ããã*
[*Gitã®`log`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-log)
### ã³ããããã°ã®æ€çŽ¢
æå®ããæååãä»ãŸã§ã®ã³ãããã»ã¡ãã»ãŒãžããæ€çŽ¢ããŠããã£ãšãæ°ãããã®ã衚瀺ããããšãã§ããã
```bash
$ git show :/query
```
`query`ãæ€çŽ¢ãããæååïŒå€§æåãšå°æåãåºå¥ããïŒã§çœ®ãæãããšãææ°ã®ã³ãããããã®ã³ãããã«ãããå·®åãšåæã«è¡šç€ºãããã
```bash
$ git show :/typo
```

泚: çµäºããã«ã¯`q`ãæŒãã
### Git Grep
Git Grepã¯æå®ãããã¿ãŒã³ã«äžèŽããè¡ã®äžèЧãè¿ããŠãããã
å®è¡ãããš:
```bash
$ git grep aliases
```
*aliases*ãšããæåãå«ããã¡ã€ã«ãå
šãŠè¡šç€ºããããšã ããã

泚: çµäºããã«ã¯`q`ãæŒãã
è€æ°ã®ãã©ã°ãçµã¿åãããããšã§ãããé«åºŠãªæ€çŽ¢ãè¡ãããšãã§ãããäŸãã°:
* `-e` 次ã®ãã©ã¡ãŒã¿ãŒããã¿ãŒã³ãšãã (äŸ: regex)
* `--and`ã`--or`ãš`--not` è€æ°ã®ãã¿ãŒã³ãçµã¿åããã
以äžã®ããã«ããŠäœ¿ã:
```bash
$ git grep -e pattern --and -e anotherpattern
```
[*Gitã®`grep`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-grep)
### ããŒãžæžã¿ãã©ã³ã
以äžã®ããã«å®è¡ãããš:
```bash
$ git branch --merged
```
çŸåšã®ãã©ã³ãã«æ¢ã«ããŒãžããããã©ã³ãã®äžèЧã衚瀺ãããã
éã«:
```bash
$ git branch --no-merged
```
ãããããšãŸã ããŒãžãããŠããªããã©ã³ãã衚瀺ãããã ããã
[*Gitã®`branch`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-branch)
### FixupãšAutosquash
ãããŸã§ã®ã³ããã(HEADã®çŽåã§ãªããŠãæ§ããªã)ãäŸãã°`abcde`ãšãããã§ãã¯ãµã ã®ã³ãããã§äœãåé¡ãèŠã€ããå Žåã以äžã®æ§ãªã³ãã³ãã§åé¡ã®ä¿®æ£ãè¡ãããšãã§ãã:
```bash
$ git commit --fixup=abcde
$ git rebase abcde^ --autosquash -i
```
[*Gitã®`commit`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-commit)
[*Gitã®`rebase`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-rebase)
### ããŒã«ã«ã»ãªããžããªãåç
§ãããŠã§ããµãŒããŒ
Gitã®`instaweb`ã³ãã³ããå©çšãããšãèªåã®äœæ¥ãªããžããªã`gitweb`ã§åç
§ããããšãã§ããããã®ã³ãã³ãã¯`gitweb`ãšãŠã§ããµãŒããŒãã»ããã¢ããããŠããŒã«ã«ã»ãªããžããªããã©ãŠã¶ãŒã§éããããã«ããç°¡åãªã¹ã¯ãªããã ã
```bash
$ git instaweb
```
以äžã®ãããªããŒãžãéããã:

[*Gitã®`instaweb`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-instaweb)
### Gitã®èšå®
`.gitconfig`ãšã¯ããããèšå®ãæžã蟌ãŸãããã¡ã€ã«ã ã
#### ãšã€ãªã¢ã¹
ãšã€ãªã¢ã¹ã¯Gitã®åŒã³åºãæ¹ãèªåã§å¥œããªããã«å®çŸ©ã§ãããã«ããŒæ©èœã ãäŸãã°`git a`ã§`git add --all`ãå®è¡ããããã«ããããšãã§ããã
ãšã€ãªã¢ã¹ã远å ããã«ã¯`~/.gitconfig`ãéãã以äžã®ãããªåœ¢åŒã§èšè¿°ããŠãã:
```
[alias]
co = checkout
cm = commit
p = push
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
```
ãŸãã¯ã³ãã³ãã©ã€ã³ãããèšå®ã§ãã:
```bash
$ git config --global alias.new_alias git_function
```
äŸ:
```bash
$ git config --global alias.cm commit
```
泚: ãšã€ãªã¢ã¹ãè€æ°ã®ã³ãã³ããããªãå Žåã¯ã¯ãªãŒãã§æ¬ãå¿
èŠããã:
```bash
$ git config --global alias.ac 'add -A . && commit'
```
ããããã®èšå®ãæããŠããã:
| ãšã€ãªã¢ã¹ | ã³ãã³ã | èšå®æ¹æ³ |
| --- | --- | --- |
| `git cm` | `git commit` | `git config --global alias.cm commit` |
| `git co` | `git checkout` | `git config --global alias.co checkout` |
| `git ac` | `git add . -A` `git commit` | `git config --global alias.ac '!git add -A && git commit'` |
| `git st` | `git status -sb` | `git config --global alias.st 'status -sb'` |
| `git tags` | `git tag -l` | `git config --global alias.tags 'tag -l'` |
| `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` |
| `git cleanup` | `git branch --merged \| grep -v '*' \| xargs git branch -d` | `git config --global alias.cleanup "!git branch --merged \| grep -v '*' \| xargs git branch -d"` |
| `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` |
| `git lg` | `git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --` | `git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"` |
#### ã³ãã³ãã®èªåä¿®æ£
å€åä»ã¯`git comit`ãšã¿ã€ãããå Žåã以äžã®ãããªåºåãåŸãããšã ãã:
```bash
$ git comit -m "Message"
# git: 'comit' is not a git command. See 'git --help'.
# Did you mean this?
# commit
```
ããã`comit`ãšã¿ã€ãããæã«`commit`ãå®è¡ããããå Žåãèªåä¿®æ£ãæå¹ã«ããã°è¯ã:
```bash
$ git config --global help.autocorrect 1
```
ãããšä»¥äžã®ãããªåºåãåŸãããã«ãªãã ãã:
```bash
$ git comit -m "Message"
# WARNING: You called a Git command named 'comit', which does not exist.
# Continuing under the assumption that you meant 'commit'
# in 0.1 seconds automatically...
```
#### è²èšå®
Gitã®åºåãã«ã©ãã«ã«ããã«ã¯ä»¥äžã®ãããªèšå®ãå ãããšè¯ã:
```bash
$ git config --global color.ui 1
```
[*Gitã®`config`ã³ãã³ãã«ã€ããŠãã£ãšè©³ãã*](http://git-scm.com/docs/git-config)
### Gitæ
å ±
| Title | Link |
| ----- | ---- |
| Official Git Site | http://git-scm.com/ |
| Official Git Video Tutorials | http://git-scm.com/videos |
| Code School Try Git | http://try.github.com/ |
| Introductory Reference & Tutorial for Git | http://gitref.org/ |
| Official Git Tutorial | http://git-scm.com/docs/gittutorial |
| Everyday Git | http://git-scm.com/docs/everyday |
| Git Immersion | http://gitimmersion.com/ |
| Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ |
| Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ |
| GitHub Training Kit | http://training.github.com/kit |
| Git Visualization Playground | http://onlywei.github.io/explain-git-with-d3/#freeplay |
#### Git Books
| Title | Link |
| ----- | ---- |
| Pragmatic Version Control Using Git | http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git |
| Pro Git | http://git-scm.com/book |
| Git Internals PluralSight | https://github.com/pluralsight/git-internals-pdf |
| Git in the Trenches | http://cbx33.github.com/gitt/ |
| Version Control with Git | http://www.amazon.com/Version-Control-Git-collaborative-development/dp/1449316387 |
| Pragmatic Guide to Git | http://www.pragprog.com/titles/pg_git/pragmatic-guide-to-git |
| Git: Version Control for Everyone | http://www.packtpub.com/git-version-control-for-everyone/book |
## 蚳泚
ããã¯[GitHub Cheat Sheet](https://github.com/tiimgreen/github-cheat-sheet)ã®æ¥æ¬èªèš³ã§ããã