From 307aa0001fa751988c1d0c41a89cdb38c48438fb Mon Sep 17 00:00:00 2001 From: Bernhard Millauer Date: Sun, 13 Apr 2014 23:35:56 +0200 Subject: [PATCH 001/292] Added cross repo comparision --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 88fcf69..5ebbc43 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,19 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` which allows you to see the difference on the master branch up a set time ago or a specified date. +### Compare branches cross forked repositories + +To use GitHub to compare branches across forked repositories, change the URL to look like this: + +``` +https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +``` + +eg.: +``` +https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master +``` + ## Line Highlighting in Repos Either adding `#L52` to the end of a code file URL or simply clicking the lin number will highlight that line number. From def073ea840c8d8a4f6d0e747dfb29f19668b54b Mon Sep 17 00:00:00 2001 From: "Daniel W. Crompton" Date: Mon, 14 Apr 2014 00:06:25 +0200 Subject: [PATCH 002/292] Update README.md As this only works on the master branch this should be made clear. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88fcf69..fa1706c 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ To see all of the shortcuts for the current page press `?`. ## Closing Issues with Commits -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. +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 once it is commited to the master branch. ```bash $ git commit -m "Fix cock up, fixes #12" From fad85aea07af9388104e2a99cfb9219a94c9796b Mon Sep 17 00:00:00 2001 From: Dennis Ideler Date: Sun, 13 Apr 2014 19:31:55 -0400 Subject: [PATCH 003/292] Fix minor typo lin -> line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88fcf69..344bbb6 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ which allows you to see the difference on the master branch up a set time ago or ## Line Highlighting in Repos -Either adding `#L52` to the end of a code file URL or simply clicking the lin number will highlight that line number. +Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines: From 5ceb541bd842a96dbcd6292f2134eb5a9a7a0f67 Mon Sep 17 00:00:00 2001 From: Dennis Ideler Date: Sun, 13 Apr 2014 18:39:40 -0400 Subject: [PATCH 004/292] Add section on relative links in markdown Recommend the use of relative links over absolute links when linking to internal content. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 ``` +## Relative Links + +[Relative links](https://help.github.com/articles/relative-links-in-readmes) are recommended in your Markdown files when linking to internal content. + +```markdown +[Link to a header](#awesome-section) + +[Link to a file](docs/readme) +``` + +Absolute links have to be updated whenever the URL changes (e.g. repo renamed, username changed, project forked). +Using relative links makes your documentation easily stand on its own. + ## .gitconfig Recommendations Your `.gitconfig` is the file that contains all your preferences. From 863d0e19beccb85714f6902a643278f31f97b2d1 Mon Sep 17 00:00:00 2001 From: Matias Singers Date: Mon, 14 Apr 2014 10:37:18 +0800 Subject: [PATCH 005/292] Add Git aliases for tags, branches and remotes Taken from @mathiasbynens dotfiles: https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 88fcf69..5b61154 100644 --- a/README.md +++ b/README.md @@ -396,6 +396,10 @@ To add an alias, either navigate to `~/.gitconfig` and fill it out in the follow co = checkout cm = commit p = push + # Show verbose output about tags, branches or remotes + tags = tag -l + branches = branch -a + remotes = remote -v ``` or type in the command line: @@ -421,6 +425,9 @@ Some recommendations include: | `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 remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | ### Auto-correct From c86ecdde7e4bee9c2640d983568ef4ebc5adf790 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Mon, 14 Apr 2014 12:37:55 +0900 Subject: [PATCH 006/292] Fix typo lin -> line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88fcf69..344bbb6 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ which allows you to see the difference on the master branch up a set time ago or ## Line Highlighting in Repos -Either adding `#L52` to the end of a code file URL or simply clicking the lin number will highlight that line number. +Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines: From f0d3e503a84ee498d735277212f48ef326bfccd6 Mon Sep 17 00:00:00 2001 From: Bernhard Millauer Date: Mon, 14 Apr 2014 09:58:59 +0200 Subject: [PATCH 007/292] Fixed a typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ebbc43..823c5c3 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` which allows you to see the difference on the master branch up a set time ago or a specified date. -### Compare branches cross forked repositories +### Compare branches across forked repositories To use GitHub to compare branches across forked repositories, change the URL to look like this: From 9886100f08c93f1acefe88d654eb87e86865dd96 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 10:36:59 +0100 Subject: [PATCH 008/292] Add label hotkey (fixes #19) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ddc50c8..43275aa 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,8 @@ Pressing `w` will bring up the branch selector. Pressing `s` will select the search bar. +Pressing `l` will edit labels on existing issues. + 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. To see all of the shortcuts for the current page press `?`. From e70c204e3d7cb154f5866b575d01c1da14b68a6c Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 12:37:57 +0100 Subject: [PATCH 009/292] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bc494e..40022d2 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ To see all of the shortcuts for the current page press `?`. ## Closing Issues with Commits -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 once it is commited to the master branch. +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 once it is committed to the master branch. ```bash $ git commit -m "Fix cock up, fixes #12" From 1b5e9c949d1eefac92cce12502494d75b0a010fb Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 13:12:26 +0100 Subject: [PATCH 010/292] Add links to docs --- README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 40022d2..90512db 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed. +[*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) + ## Cloning a Repo When cloning a repo the `.git` can be left off the end. @@ -46,6 +48,8 @@ When cloning a repo the `.git` can be left off the end. $ git clone https://github.com/tiimgreen/github-cheat-sheet ``` +[*Read more about the Git `clone` command.*](http://git-scm.com/docs/git-clone) + ## Hub - Git Wrapper [Hub](https://github.com/github/hub) is a command line git wrapper that gives extra features and commands that make working with GitHub easier. @@ -83,12 +87,16 @@ $ git checkout - # Switched to branch 'master' ``` +[*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) + ## git.io [git.io](http://git.io) is a simple URL shortener for GitHub. [http://git.io/wO0xUg](http://git.io/wO0xUg) +[*Read more about Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) + ## Gists [Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repo. @@ -100,6 +108,8 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) +[*Read more about creating gists.*](https://help.github.com/articles/creating-gists) + ## Keyboard Shortcuts When on a repo page keyboard shortcuts allow you to navigate easily. @@ -116,6 +126,8 @@ Pressing `y` __when looking at a file__ (e.g. `https://github.com/tiimgreen/gith To see all of the shortcuts for the current page press `?`. +[*Read more about using the Command Bar.*](https://help.github.com/articles/using-the-command-bar) + ## Closing Issues with Commits 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 once it is committed to the master branch. @@ -128,6 +140,8 @@ This closes the issue and references the closing commit. ![Closing Repo](http://i.imgur.com/URXFprQ.png) +[*Read more about closing issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) + ## Checking out Pull Requests If you want to check out pull request locally, you can fetch it using that command: @@ -170,6 +184,8 @@ and even fetch them automatically, if you add corresponding lines in your .git/c fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` +[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) + ## Cross-link Issues If you want to link to another issue in the same repo, simple type hash `#` then the issue number, it will be auto-linked. @@ -198,6 +214,8 @@ puts table.to_s GitHub uses [Linguist](https://github.com/github/linguist) to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing the [languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml). +[*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) + ## Commit History by Author To view all commits on a repo by author add `?author=username` to the URL. @@ -206,6 +224,8 @@ To view all commits on a repo by author add `?author=username` to the URL. https://github.com/rails/rails/commits/master?author=dhh ``` +[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) + ## Empty Commits Commits can be pushed with no code changes by adding `--allow-empty` @@ -238,6 +258,8 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` which allows you to see the difference on the master branch up a set time ago or a specified date. +[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) + ### Compare branches across forked repositories To use GitHub to compare branches across forked repositories, change the URL to look like this: @@ -307,6 +329,8 @@ When on a comment thread and you want to quote something someone previously said ![Quick Quote](http://i.imgur.com/TzpMIOA.png) +[*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) + ## Styled Git Status ```bash @@ -323,6 +347,8 @@ $ git status -sb ![git status -sb](http://i.imgur.com/xNI1bT0.png) +[*Read more about the Git `status` command.*](http://git-scm.com/docs/git-status) + ## Styled Git Log ```bash @@ -333,6 +359,8 @@ $ git log --all --graph --decorate --oneline --abbrev-commit NOTE: This can be added into an Alias (shorter command) using the instructions [here](https://github.com/tiimgreen/github-cheat-sheet#aliases) +[*Read more about the Git `log` command.*](http://git-scm.com/docs/git-log) + ## Git Query A git query allows you to search all your previous commit messages and finds the most recent one matching the query. @@ -366,6 +394,8 @@ $ git branch --no-merged Will give you a list of branches that have not been merged into your current branch. +[*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch) + ## Quick Licensing When creating a repo GitHub gives you the options of adding in a pre-made license: @@ -378,6 +408,8 @@ You can also add them to existing repos by creating a new file through the web i Also works for `.gitignore`. +[*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing) + ## TODO Lists In Issues and Pull requests check boxes can be added with the following syntax (notice the space): @@ -397,9 +429,11 @@ When they are clicked, they will be updated in the pure Markdown: - [ ] Sleep ``` +[*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) + ## Relative Links -[Relative links](https://help.github.com/articles/relative-links-in-readmes) are recommended in your Markdown files when linking to internal content. +Relative links are recommended in your Markdown files when linking to internal content. ```markdown [Link to a header](#awesome-section) @@ -410,6 +444,8 @@ When they are clicked, they will be updated in the pure Markdown: Absolute links have to be updated whenever the URL changes (e.g. repo renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own. +[*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes) + ## .gitconfig Recommendations Your `.gitconfig` is the file that contains all your preferences. @@ -492,6 +528,8 @@ To add more colour to your git command line: $ git config --global color.ui 1 ``` +[*Read more about the Git `config` command.*](http://git-scm.com/docs/git-config) + # Sharing Share on [Twitter](https://twitter.com/intent/tweet?source=webclient&text=http%3A%2F%2Fgithub.com%2Ftiimgreen%2Fgithub-cheat-sheet%20-%20GitHub%20Cheat%20Sheet) From 3d1d9a5cbc38bf33b54521c1faf1161cf8c154a3 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 13:28:48 +0100 Subject: [PATCH 011/292] Add Friction example --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 90512db..3eb433e 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Ignore Whitespace](#ignore-whitespace) - [Cloning a Repo](#cloning-a-repo) - [Hub - Git Wrapper](#hub---git-wrapper) +- [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Previous Branch](#previous-branch) - [git.io](#gitio) - [Gists](#gists) @@ -66,6 +67,13 @@ instead of: $ git clone https://github.com/tiimgreen/toc.git ``` +## Decreasing Contributor Friction +If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? + +[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common answers to these questions. This is some example output: + +[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) + ## Previous Branch To move to the previous directory in the command line: From cfcb044ded8b5d59238aeb385eef480f3d8a9fc1 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:04:53 +0100 Subject: [PATCH 012/292] :cat: + :rabbit: = sweeter than Chuck Norris --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3eb433e..2c63d11 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,7 @@ Images and GIFs can be added to comments, READMEs etc.: ![Alt Text](http://image_url.com/image.jpg) ``` -![Chuck Norris](http://gifs.joelglovier.com/chuck-norris/chuck-norris.gif) +![Cat and Rabbit](http://i.imgur.com/PoBmL0W.gif) All images are cached on GitHub, so if your host goes down, the image will remain available. From 04654237494041204028876cfdb36338c8e3cb20 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 14 Apr 2014 14:10:22 +0100 Subject: [PATCH 013/292] Update git query Image --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c63d11..25e910b 100644 --- a/README.md +++ b/README.md @@ -382,7 +382,7 @@ Where `query` is the term you want to search, this then finds the last one and g ```bash $ git show :/typo ``` -![git show :/query](http://i.imgur.com/SA0oZbE.png) +![git show :/query](http://i.imgur.com/icaGiNt.png) NOTE: Press `q` to quit. From bc9f34a0760d07d3e771563ff57a535f6cb01f12 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:23:53 +0100 Subject: [PATCH 014/292] Add link to Hub commands docs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 25e910b..189ab7a 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,8 @@ instead of: $ git clone https://github.com/tiimgreen/toc.git ``` +[*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) + ## Decreasing Contributor Friction If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? From 18694b1718c6e27f1a0d5da43e18eaecbde95430 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:26:05 +0100 Subject: [PATCH 015/292] It's 'Task Lists' not 'TODO Lists' --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 189ab7a..fecd89d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Git Query](#git-query) - [Merged Branches](#merged-branches) - [Quick Licensing](#quick-licensing) -- [TODO Lists](#todo-lists) +- [Task Lists](#task-lists) - [Relative Links](#relative-links) - [.gitconfig Recommendations](#gitconfig-recommendations) - [Aliases](#aliases) @@ -420,7 +420,7 @@ Also works for `.gitignore`. [*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing) -## TODO Lists +## Task Lists In Issues and Pull requests check boxes can be added with the following syntax (notice the space): ``` @@ -429,7 +429,7 @@ In Issues and Pull requests check boxes can be added with the following syntax ( - [ ] Sleep ``` -![TODO List](http://i.imgur.com/k2qZi56.png) +![Task List](http://i.imgur.com/k2qZi56.png) When they are clicked, they will be updated in the pure Markdown: From 46be82be05b730609f156a6b8aad76a367578509 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:28:09 +0100 Subject: [PATCH 016/292] Use GIF for quick quoting example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fecd89d..44f1201 100644 --- a/README.md +++ b/README.md @@ -337,7 +337,7 @@ All images are cached on GitHub, so if your host goes down, the image will remai When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. -![Quick Quote](http://i.imgur.com/TzpMIOA.png) +![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) [*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) From 19e0038601a3059e9ff71a4af482e2f2b4b38293 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:36:05 +0100 Subject: [PATCH 017/292] Add section on repository metadata and plugin support for GitHub Pages --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 44f1201..5b077d5 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Empty Commits](#empty-commits) - [Comparing Branches](#comparing-branches) - [Line Highlighting in Repos](#line-highlighting-in-repos) +- [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) - [Quick Quoting](#quick-quoting) @@ -295,6 +296,13 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Line Highlighting](http://i.imgur.com/8AhjrCz.png) +## Metadata and Plugin Support for GitHub Pages +Within Jekyll pages and posts, repository information is available within the `site.github` namespace, and can be displayed, for example, using `{{ site.github.project_title }}`. + +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. + +[*Read more about repository metadata and plugin support for GitHub Pages.*](Repository metadata and plugin support for GitHub Pages) + ## Emojis Emojis can be generated on Pull Requests, Issues, Commit Messages, READMEs, etc. using `:name_of_emoji:` From 77d693f77f1c6136b4c27dbe10e91af548ee2927 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Mon, 14 Apr 2014 18:57:03 +0900 Subject: [PATCH 018/292] Translate in korean --- README.ko.md | 469 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 469 insertions(+) create mode 100644 README.ko.md diff --git a/README.ko.md b/README.ko.md new file mode 100644 index 0000000..804f977 --- /dev/null +++ b/README.ko.md @@ -0,0 +1,469 @@ +# GitHub Cheat Sheet + +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)). + +# Contents + +- [Ignore Whitespace](#ignore-whitespace) +- [Cloning a Repo](#cloning-a-repo) +- [Hub - Git Wrapper](#hub---git-wrapper) +- [Previous Branch](#previous-branch) +- [git.io](#gitio) +- [Gists](#gists) +- [Keyboard Shortcuts](#keyboard-shortcuts) +- [Closing Issues with Commits](#closing-issues-with-commits) +- [Checking out Pull Requests](#checking-out-pull-requests) +- [Cross-Link Issues](#cross-link-issues) +- [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) +- [Commit History by Author](#commit-history-by-author) +- [Empty Commits](#empty-commits) +- [Comparing Branches](#comparing-branches) +- [Line Highlighting in Repos](#line-highlighting-in-repos) +- [Emojis](#emojis) +- [Images/GIFs](#imagesgifs) +- [Quick Quoting](#quick-quoting) +- [Styled Git Status](#styled-git-status) +- [Styled Git Log](#styled-git-log) +- [Git Query](#git-query) +- [Merged Branches](#merged-branches) +- [Quick Licensing](#quick-licensing) +- [TODO Lists](#todo-lists) +- [.gitconfig Recommendations](#gitconfig-recommendations) + - [Aliases](#aliases) + - [Auto-correct](#auto-correct) + - [Color](#color) + +## Ignore Whitespace + +`?w=1`를 diff URL에 추가하면 변경된 코드만 볼 수 있도록, 공백만 바뀐 수정을 제거할 수 있습니다. + +## Cloning a Repo + +저장소를 클론할 때, 맨 뒤의 `.git`은 생략할 수 있습니다. + +```bash +$ git clone https://github.com/tiimgreen/github-cheat-sheet +``` + +## Hub - Git Wrapper + +[Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. + +이런 명령 대신에 + +```bash +$ git clone https://github.com/tiimgreen/toc.git +``` + +이렇게 할 수 있습니다. + +```bash +$ hub clone tiimgreen/toc +``` + +## Previous Branch + +커맨드 라인에서 이전 디렉터리로 이동하려면 이렇게 합니다. + +```bash +$ cd - +``` + +비슷하게, 깃에서 마지막 브랜치로 돌아가는 건 이렇게 할 수 있습니다. + +```bash +$ git checkout - +# Switched to branch 'master' + +$ git checkout - +# Switched to branch 'next' + +$ git checkout - +# Switched to branch 'master' +``` + +## git.io + +[git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. + +[http://git.io/wO0xUg](http://git.io/wO0xUg) + +## Gists + +[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. + +쉬운 방법이긴 하지만, Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다. + +```bash +$ git clone https://gist.github.com/tiimgreen/10545817 +``` + +![Gists](http://i.imgur.com/dULZXXo.png) + +## Keyboard Shortcuts + +저장소 페이지에서 단축키를 사용하면 쉽게 이동할 수 있습니다. + +`t`를 누르면 파일 탐색 페이지로 이동합니다. + +`w`를 누르면 브렌치 선택 페이지로 이동합니다. + +`s`를 누르면 검색 창으로 이동합니다. + +__파일을 보고 있을 때__ (예를 들어 `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`) `y`를 누르면 URL을 지금 보고 있는 페이지를 사실상 고정하도록 합니다. 코드가 바뀐다고 해도 이번에 본 내용을 다시 볼 수 있습니다. + +지금 페이지에서 쓸 수 있는 모든 단축키를 보시려면 `?`를 누르세요. + +## Closing Issues with Commits + +어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`나 `close/closes/closed`를 키워드로 해당 이슈를 닫을 수 있습니다. + +```bash +$ git commit -m "Fix cock up, fixes #12" +``` + +이렇게 하면 이슈를 닫고 클로징 커맨트로 참조하게 합니다. + +![Closing Repo](http://i.imgur.com/URXFprQ.png) + +## Checking out Pull Requests + +풀 리퀘스트를 체크아웃하려면, 다음 명령어로 가져올 수 있습니다. + +```bash +$ git fetch origin '+refs/pull/*/head:refs/pull/*' +``` + +그리고 다음 명령을 사용해 풀 리퀘스트(예를 들어 42라면)를 체크아웃합니다. + +```bash +$ git checkout refs/pull/42 +``` + +아니면, 리모트 브랜치에서 가져올 수도 있습니다. + +```bash +$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' +``` + +그리고 체크아웃은 이렇게 합니다. + +```bash +$ git checkout origin/pr/42 +``` + +그리고 밑의 줄을 .git/config에 추가하면, 자동으로 가져오게도 할 수 있습니다. + +``` +[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/* +``` + +## Cross-link Issues + +같은 저장소의 다른 이슈를 링크하기 원한다면, `#`뒤에 이슈 번호만 입력하시면 자동으로 링크됩니다. + +다른 저장소의 이슈를 링크하고 싶다면 `사람_이름/저장소_이름#이슈_번호`로 할 수 있습니다. (예 `tiimgreen/toc#12`) + +## Syntax Highlighting in Markdown Files + +마크다운에서 예를 들어, 루비 코드를 신텍스 하이라이트 하려면 이렇게 합니다. + + ```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 +``` + +깃허브는 [Linguist](https://github.com/github/linguist)를 사용해 언어를 감지하고 신텍스를 하이라이트합니다. [언어 YAML 파일](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)을 정독하시면 어떤 키워드가 유효한지 확인하실 수 있습니다. + +## Commit History by Author + +특정 커미터가 한 모든 커밋을 보고 싶다면 URL에 `?author=username`를 추가하세요. + +``` +https://github.com/rails/rails/commits/master?author=dhh +``` + +## Empty Commits + +`--allow-empty`를 추가하시면 코드의 변경 없이 커밋을 넣을 수 있습니다. + +```bash +$ git commit -m "Big-ass commit" --allow-empty +``` + +![Trololol](http://img1.wikia.nocookie.net/__cb20130905205853/flylikeabird3/images/0/0c/Mexican_troll_face_by_mariodude12312-d5mtl9z.png) + +## Comparing Branches + +깃허브에서 브랜치 비교를 하시려면, 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 +``` + +이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다. + +## Line Highlighting in Repos + +코드 파일 URL의 끝에 `#L52`를 추가하거나 줄 번호를 클릭하면 그 줄 번호를 하이라이트합니다. + +`#L53-L60`처럼 범위지정도 가능합니다. 범위를 지정하려면 `shift`키를 누른 채 두 라인을 클릭하면 됩니다. + +``` +https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 +``` + +![Line Highlighting](http://i.imgur.com/8AhjrCz.png) + +## Emojis + +에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등등에서 `:에모지의_이름:`으로 만들 수 있습니다. + +``` +:smile: +:poop: +:shipit: +:+1: +``` + +:smile: +:poop: +:shipit: +:+1: + +깃허브에서 사용 가능한 에모지의 전 목록은 [여기](http://www.emoji-cheat-sheet.com/) 나 [여기](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. + +깃허브에서 많이 사용하는 에모지 탑 5위는 이렇습니다. + +1. :shipit: `:shipit:` +2. :sparkles: `:sparkles:` +3. :-1: `:-1:` +4. :+1: `:+1:` +5. :clap: `:clap:` + +## Images/GIFs + +커맨트나 README등등에 이미지와 GIF를 넣을 수 있습니다. + +``` +![Alt Text](http://image_url.com/image.jpg) +``` + +![Chuck Norris](http://gifs.joelglovier.com/chuck-norris/chuck-norris.gif) + +모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다. + +## Quick Quoting + +스레드에 답글들 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다. + +![Quick Quote](http://i.imgur.com/TzpMIOA.png) + +## Styled Git Status + +```bash +$ git status +``` + +![git status](http://i.imgur.com/o3PEHAA.png) + +이렇게 바뀝니다. + +```bash +$ git status -sb +``` + +![git status -sb](http://i.imgur.com/xNI1bT0.png) + +## Styled Git Log + +```bash +$ git log --all --graph --decorate --oneline --abbrev-commit +``` + +![git log --all --graph --decorate --oneline --abbrev-commit](http://i.imgur.com/RUPycwI.png) + +NOTE: 이 명령을 알리아스 (단축 명령)으로 넣을 수 있습니다. [여기](#aliases)의 소개를 보세요. + +## Git Query + +깃 쿼리는 모든 이전 커밋 메시지에서 검색해 가장 최근의 쿼리에 맞는 커밋을 찾아줍니다. + +```bash +$ git show :/query +``` + +`query`에는 검색하고 싶은 말을 넣으세요. 주어진 검색어가 있는 가장 마지막 커밋을 표시하고 변경된 라인을 보여줍니다. + +```bash +$ git show :/typo +``` +![git show :/query](http://i.imgur.com/SA0oZbE.png) + +NOTE: 나오려면 `q`를 누르세요. + +## Merged Branches + +```bash +$ git branch --merged +``` + +이 명령어는 현재 브랜치에 머지된 모든 브랜치의 목록을 보여줍니다. + +거꾸로 + +```bash +$ git branch --no-merged +``` + +이 명령어는 현재 브랜치에 머지되지 않은 브랜치의 목록을 보여줍니다. + +## Quick Licensing + +저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. + +![Licese](http://i.imgur.com/Chqj4Fg.png) + +이미 있는 저장소에도 웹 인터페이스에서 새 파일을 만들어 추가할 수 있습니다. +이름에 `LICENSE`를 입력하면 옵션으로 템플릿을 사용할 수 있습니다. + +![License](http://i.imgur.com/fTjQict.png) + +`.gitignore`에도 똑같이 적용됩니다. + +## TODO Lists + +이슈와 풀 리퀘스트에서 밑의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.) + +``` +- [ ] Be awesome +- [ ] Do stuff +- [ ] Sleep +``` + +![TODO List](http://i.imgur.com/k2qZi56.png) + +체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다. + +``` +- [x] Be awesome +- [x] Do stuff +- [ ] Sleep +``` + +## .gitconfig Recommendations + +`.gitconfig`는 모든 설정이 들어있는 파일입니다. + +### Aliases + +알리아스는 커스텀 깃 명령어를 등록할 수 있는 핼퍼입니다. 예를 들어 `git a`로 `git add --all`를 실행하게 할 수 있습니다. + +알리아스를 추가하려면 `~/.gitconfig`를 찾아 다음 포멧으로 입력하거나 + +``` +[alias] + co = checkout + cm = commit + p = push +``` + +커맨드 라인에서 다음 명령을 입력합니다. + +```bash +$ git config alias.new_alias git_function +``` + +예를들면 + +```bash +$ git config alias.cm commit +``` + +NOTE: 여러 함수를 알리아스하려면 따옴표를 이용하세요. + +```bash +$ git config alias.ac 'add -A . && commit' +``` + +여기 몇 가지 권장 알리아스가 있습니다. + +| Alias | Current Command | What to Type | +| --- | --- | --- | +| `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'` | + +### Auto-correct + +현재 `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... +``` + +### Color + +깃 커맨드 라인에 색을 넣으려면 이렇게 하세요. + +```bash +$ git config --global color.ui 1 +``` + +# Sharing + +[트위터](https://twitter.com/intent/tweet?source=webclient&text=http%3A%2F%2Fgit.io%2FvvT17g%20-%20GitHub%20치트%20시트)에 공유하기 From 2299a049baa92e79345d8dec59565c4ebcd4b246 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:42:08 +0100 Subject: [PATCH 019/292] Add section on rendered prose diffs :cat: --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5b077d5..efde86a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Comparing Branches](#comparing-branches) - [Line Highlighting in Repos](#line-highlighting-in-repos) - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) +- [Rendered Prose Diffs](#rendered-prose-diffs) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) - [Quick Quoting](#quick-quoting) @@ -303,6 +304,13 @@ The Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](h [*Read more about repository metadata and plugin support for GitHub Pages.*](Repository metadata and plugin support for GitHub Pages) +## Rendered Prose Diffs +Commits and pull requests including prose files feature *source* and *rendered* views. Click the "rendered" button to see the changes as they'll appear in the rendered document. Rendered prose view is handy when you're adding, removing, and editing text: + +![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) + +[*Read more about rendered prose diffs.*](https://github.com/blog/1784-rendered-prose-diffs) + ## Emojis Emojis can be generated on Pull Requests, Issues, Commit Messages, READMEs, etc. using `:name_of_emoji:` From 41bdc9dda85a581ba85f63420cd260a867bb998f Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:47:24 +0100 Subject: [PATCH 020/292] Add section on cool :octocat: diffable maps --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index efde86a..d96042e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Line Highlighting in Repos](#line-highlighting-in-repos) - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) - [Rendered Prose Diffs](#rendered-prose-diffs) +- [Diffable Maps](#diffable-maps) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) - [Quick Quoting](#quick-quoting) @@ -311,6 +312,11 @@ Commits and pull requests including prose files feature *source* and *rendered* [*Read more about rendered prose diffs.*](https://github.com/blog/1784-rendered-prose-diffs) +## Diffable Maps +Any time you view a commit or pull request on GitHub that includes geodata, GitHub will render a visual representation of what was changed. + +[![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) + ## Emojis Emojis can be generated on Pull Requests, Issues, Commit Messages, READMEs, etc. using `:name_of_emoji:` From e062f45c2e2ac4c307774150f790480543d99a31 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:48:20 +0100 Subject: [PATCH 021/292] Add link to diffable maps blog post --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d96042e..ac590d8 100644 --- a/README.md +++ b/README.md @@ -317,6 +317,8 @@ Any time you view a commit or pull request on GitHub that includes geodata, GitH [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) +[*Read more about diffable maps.*](https://github.com/blog/1772-diffable-more-customizable-maps) + ## Emojis Emojis can be generated on Pull Requests, Issues, Commit Messages, READMEs, etc. using `:name_of_emoji:` From 60a542c4795378c850cec8316ee69fd79b9d7d38 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:50:38 +0100 Subject: [PATCH 022/292] Add 'diffs' section --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ac590d8..116281e 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,9 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Comparing Branches](#comparing-branches) - [Line Highlighting in Repos](#line-highlighting-in-repos) - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) -- [Rendered Prose Diffs](#rendered-prose-diffs) -- [Diffable Maps](#diffable-maps) +- [Diffs](#diffs) + - [Rendered Prose Diffs](#rendered-prose-diffs) + - [Diffable Maps](#diffable-maps) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) - [Quick Quoting](#quick-quoting) @@ -305,14 +306,15 @@ The Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](h [*Read more about repository metadata and plugin support for GitHub Pages.*](Repository metadata and plugin support for GitHub Pages) -## Rendered Prose Diffs +## Diffs +### Rendered Prose Diffs Commits and pull requests including prose files feature *source* and *rendered* views. Click the "rendered" button to see the changes as they'll appear in the rendered document. Rendered prose view is handy when you're adding, removing, and editing text: ![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) [*Read more about rendered prose diffs.*](https://github.com/blog/1784-rendered-prose-diffs) -## Diffable Maps +### Diffable Maps Any time you view a commit or pull request on GitHub that includes geodata, GitHub will render a visual representation of what was changed. [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) From 7ed1ce6711076328feef0197df461496f9b1cb53 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 14:54:46 +0100 Subject: [PATCH 023/292] Add section on 'Expanding Context in Diffs' --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 116281e..8a5b320 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Diffs](#diffs) - [Rendered Prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) + - [Expanding Context in Diffs](#expanding-context-in-diffs) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) - [Quick Quoting](#quick-quoting) @@ -321,6 +322,13 @@ Any time you view a commit or pull request on GitHub that includes geodata, GitH [*Read more about diffable maps.*](https://github.com/blog/1772-diffable-more-customizable-maps) +### Expanding Context in Diffs +Using the *unfold* button in the gutter of a diff, you can reveal additional lines of context with a click. You can keep clicking *unfold* until you've revealed the whole file, and the feature is available anywhere GitHub renders diffs. + +![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) + +[*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs) + ## Emojis Emojis can be generated on Pull Requests, Issues, Commit Messages, READMEs, etc. using `:name_of_emoji:` From 5013fc2ebabd7e6b73b86dd7a72e4dc6875a658d Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 15:12:28 +0100 Subject: [PATCH 024/292] Wrap file names in code quotes + add example to Git.io --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8a5b320..8b52507 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Hub - Git Wrapper](#hub---git-wrapper) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Previous Branch](#previous-branch) -- [git.io](#gitio) +- [Git.io](#gitio) - [Gists](#gists) - [Keyboard Shortcuts](#keyboard-shortcuts) - [Closing Issues with Commits](#closing-issues-with-commits) @@ -35,7 +35,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Quick Licensing](#quick-licensing) - [Task Lists](#task-lists) - [Relative Links](#relative-links) -- [.gitconfig Recommendations](#gitconfig-recommendations) +- [`.gitconfig` Recommendations](#gitconfig-recommendations) - [Aliases](#aliases) - [Auto-correct](#auto-correct) - [Color](#color) @@ -104,11 +104,19 @@ $ git checkout - [*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) -## git.io +## Git.io -[git.io](http://git.io) is a simple URL shortener for GitHub. +[Git.io](http://git.io) is a simple URL shortener for GitHub. You can also use it via pure HTTP using Curl: -[http://git.io/wO0xUg](http://git.io/wO0xUg) +```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/... +``` [*Read more about Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) @@ -490,7 +498,7 @@ Using relative links makes your documentation easily stand on its own. [*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes) -## .gitconfig Recommendations +## `.gitconfig` Recommendations Your `.gitconfig` is the file that contains all your preferences. From 489da3223a74fa88ee78e9f296134812a1da0d4a Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 15:15:50 +0100 Subject: [PATCH 025/292] Add example of cross-link issues --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b52507..b0f8ad9 100644 --- a/README.md +++ b/README.md @@ -209,12 +209,14 @@ and even fetch them automatically, if you add corresponding lines in your .git/c [*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) -## Cross-link Issues +## Cross-Link Issues If you want to link to another issue in the same repo, simple type hash `#` then the issue number, it will be auto-linked. To link to an issue in another repo, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. +![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) + ## Syntax Highlighting in Markdown Files For example, to syntax highlight Ruby code in your Markdown files write: From b32ba3124215fef86cd0592fa2c6a055456c6833 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 15:18:17 +0100 Subject: [PATCH 026/292] Add link to friction/wiki --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0f8ad9..2ffe6f6 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ $ git clone https://github.com/tiimgreen/toc.git ## Decreasing Contributor Friction If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? -[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common answers to these questions. This is some example output: +[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common [answers to these questions](https://github.com/rafalchmiel/friction/wiki). This is some example output: [![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) From ca77e6c72eb8c44962ee90ffd149b77d147679bb Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Mon, 14 Apr 2014 23:22:47 +0900 Subject: [PATCH 027/292] Update README.ko to 19e0038601 --- README.ko.md | 116 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 106 insertions(+), 10 deletions(-) diff --git a/README.ko.md b/README.ko.md index 804f977..d9129e0 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,12 +1,13 @@ -# GitHub Cheat Sheet +# 깃허브 치트 시트 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)). -# Contents +# 목록 - [Ignore Whitespace](#ignore-whitespace) - [Cloning a Repo](#cloning-a-repo) - [Hub - Git Wrapper](#hub---git-wrapper) +- [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Previous Branch](#previous-branch) - [git.io](#gitio) - [Gists](#gists) @@ -19,6 +20,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Empty Commits](#empty-commits) - [Comparing Branches](#comparing-branches) - [Line Highlighting in Repos](#line-highlighting-in-repos) +- [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) - [Quick Quoting](#quick-quoting) @@ -27,7 +29,8 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Git Query](#git-query) - [Merged Branches](#merged-branches) - [Quick Licensing](#quick-licensing) -- [TODO Lists](#todo-lists) +- [Task Lists](#task-lists) +- [Relative Links](#relative-links) - [.gitconfig Recommendations](#gitconfig-recommendations) - [Aliases](#aliases) - [Auto-correct](#auto-correct) @@ -37,6 +40,8 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i `?w=1`를 diff URL에 추가하면 변경된 코드만 볼 수 있도록, 공백만 바뀐 수정을 제거할 수 있습니다. +[*깃허브의 비밀을 더 읽어 보세요.*](https://github.com/blog/967-github-secrets) + ## Cloning a Repo 저장소를 클론할 때, 맨 뒤의 `.git`은 생략할 수 있습니다. @@ -45,6 +50,8 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i $ git clone https://github.com/tiimgreen/github-cheat-sheet ``` +[*깃 `clone` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-clone) + ## Hub - Git Wrapper [Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. @@ -61,6 +68,16 @@ $ git clone https://github.com/tiimgreen/toc.git $ hub clone tiimgreen/toc ``` +[*Hub가 제공하는 더 멋진 기능들을 확인해 보세요.*](https://github.com/github/hub#commands) + +## Decreasing Contributor Friction + +사람들이 사용하고 기여할 수 있는 프로젝트를 만드려면, 가장 기본적인 질문에 대답할 수 있어야합니다. 이 프로젝트는 무엇입니까? 어떻게 사용합니까? 어디까지 허용됩니까? 어떻게 기여합니까? 어떻게 개발하고 실행해야 합니까? 어떻게 새로운 기능이 이전 기능을 손상되지 않았는지 확인해야 합니까? + +[Friction](https://github.com/rafalchmiel/friction)은 이러한 일반적인 질문들의 답이 프로젝트 안에 있는지 확인하는 커맨드 라인 스크립트 입니다. 다음은 샘플 출력 입니다. + +[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) + ## Previous Branch 커맨드 라인에서 이전 디렉터리로 이동하려면 이렇게 합니다. @@ -82,12 +99,16 @@ $ git checkout - # Switched to branch 'master' ``` +[*깃 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) + ## git.io [git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. [http://git.io/wO0xUg](http://git.io/wO0xUg) +[*Git.io에 대해 더 읽어 보세요.*](https://github.com/blog/985-git-io-github-url-shortener) + ## Gists [Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. @@ -100,6 +121,8 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) +[*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) + ## Keyboard Shortcuts 저장소 페이지에서 단축키를 사용하면 쉽게 이동할 수 있습니다. @@ -110,13 +133,17 @@ $ git clone https://gist.github.com/tiimgreen/10545817 `s`를 누르면 검색 창으로 이동합니다. +`l`를 누르면 있는 이슈의 라벨을 수정할 수 있습니다. + __파일을 보고 있을 때__ (예를 들어 `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`) `y`를 누르면 URL을 지금 보고 있는 페이지를 사실상 고정하도록 합니다. 코드가 바뀐다고 해도 이번에 본 내용을 다시 볼 수 있습니다. 지금 페이지에서 쓸 수 있는 모든 단축키를 보시려면 `?`를 누르세요. +[*커맨드 바의 사용법을 더 읽어 보세요.*](https://help.github.com/articles/using-the-command-bar) + ## Closing Issues with Commits -어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`나 `close/closes/closed`를 키워드로 해당 이슈를 닫을 수 있습니다. +어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`나 `close/closes/closed`를 키워드로 해당 이슈가 마스터 브랜치에 커밋 될 때 닫을 수 있습니다. ```bash $ git commit -m "Fix cock up, fixes #12" @@ -126,6 +153,8 @@ $ git commit -m "Fix cock up, fixes #12" ![Closing Repo](http://i.imgur.com/URXFprQ.png) +[*커밋 메세지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages) + ## Checking out Pull Requests 풀 리퀘스트를 체크아웃하려면, 다음 명령어로 가져올 수 있습니다. @@ -167,6 +196,8 @@ $ git checkout origin/pr/42 fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` +[*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally) + ## Cross-link Issues 같은 저장소의 다른 이슈를 링크하기 원한다면, `#`뒤에 이슈 번호만 입력하시면 자동으로 링크됩니다. @@ -195,6 +226,8 @@ puts table.to_s 깃허브는 [Linguist](https://github.com/github/linguist)를 사용해 언어를 감지하고 신텍스를 하이라이트합니다. [언어 YAML 파일](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)을 정독하시면 어떤 키워드가 유효한지 확인하실 수 있습니다. +[*깃허브 Flavored 마크다운에 대해 더 읽어 보세요.*](https://help.github.com/articles/github-flavored-markdown) + ## Commit History by Author 특정 커미터가 한 모든 커밋을 보고 싶다면 URL에 `?author=username`를 추가하세요. @@ -203,6 +236,8 @@ puts table.to_s https://github.com/rails/rails/commits/master?author=dhh ``` +[*커밋 뷰간의 차이에 대해 더 읽어보세요.*](https://help.github.com/articles/differences-between-commit-views) + ## Empty Commits `--allow-empty`를 추가하시면 코드의 변경 없이 커밋을 넣을 수 있습니다. @@ -237,6 +272,22 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master 이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다. +[*시간으로 커밋을 비교하는 법에 대해 더 읽어 보세요.*](https://help.github.com/articles/comparing-commits-across-time) + +### Compare branches across forked repositories + +포크된 저장소간의 브랜치를 비교하려면 URL을 이렇게 변경하세요. + +``` +https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +``` + +예를 들면 + +``` +https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master +``` + ## Line Highlighting in Repos 코드 파일 URL의 끝에 `#L52`를 추가하거나 줄 번호를 클릭하면 그 줄 번호를 하이라이트합니다. @@ -249,6 +300,14 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Line Highlighting](http://i.imgur.com/8AhjrCz.png) +## Metadata and Plugin Support for GitHub Pages + +지킬로 작성된 페이지와 포스트에서, 저장소 정보는 예를 들어 `{{ site.github.project_title }}`처럼 `site.github` 이름 공간으로 사용하고 표시할 수 있습니다. + +Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis)와 [@mentions](https://github.com/blog/821)을 지킬 포스트와 페이지에서 사용하게 합니다. + +[*저장소 메타 데이타와 깃허브 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](Repository metadata and plugin support for GitHub Pages) + ## Emojis 에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등등에서 `:에모지의_이름:`으로 만들 수 있습니다. @@ -283,7 +342,7 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Alt Text](http://image_url.com/image.jpg) ``` -![Chuck Norris](http://gifs.joelglovier.com/chuck-norris/chuck-norris.gif) +![Cat and Rabbit](http://i.imgur.com/PoBmL0W.gif) 모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다. @@ -291,7 +350,9 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L 스레드에 답글들 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다. -![Quick Quote](http://i.imgur.com/TzpMIOA.png) +![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) + +[*빠른 인용에 대해 더 읽어 보세요.*](https://github.com/blog/1399-quick-quotes) ## Styled Git Status @@ -309,6 +370,8 @@ $ git status -sb ![git status -sb](http://i.imgur.com/xNI1bT0.png) +[*깃 `status` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-status) + ## Styled Git Log ```bash @@ -319,6 +382,8 @@ $ git log --all --graph --decorate --oneline --abbrev-commit NOTE: 이 명령을 알리아스 (단축 명령)으로 넣을 수 있습니다. [여기](#aliases)의 소개를 보세요. +[*깃 `log` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-log) + ## Git Query 깃 쿼리는 모든 이전 커밋 메시지에서 검색해 가장 최근의 쿼리에 맞는 커밋을 찾아줍니다. @@ -332,7 +397,8 @@ $ git show :/query ```bash $ git show :/typo ``` -![git show :/query](http://i.imgur.com/SA0oZbE.png) + +![git show :/query](http://i.imgur.com/icaGiNt.png) NOTE: 나오려면 `q`를 누르세요. @@ -352,6 +418,8 @@ $ git branch --no-merged 이 명령어는 현재 브랜치에 머지되지 않은 브랜치의 목록을 보여줍니다. +[*깃 `branch` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-branch) + ## Quick Licensing 저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. @@ -365,7 +433,9 @@ $ git branch --no-merged `.gitignore`에도 똑같이 적용됩니다. -## TODO Lists +[*오픈 소스 저작권에 대해 더 읽어 보세요.*](https://help.github.com/articles/open-source-licensing) + +## Task Lists 이슈와 풀 리퀘스트에서 밑의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.) @@ -375,7 +445,7 @@ $ git branch --no-merged - [ ] Sleep ``` -![TODO List](http://i.imgur.com/k2qZi56.png) +![Task List](http://i.imgur.com/k2qZi56.png) 체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다. @@ -385,6 +455,23 @@ $ git branch --no-merged - [ ] Sleep ``` +[*테스크 리스트에 대해 더 읽어 보세요.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) + +## Relative Links + +상대 경로 링크는 마크다운 파일이 내부 건탠츠로 링크될 때 추천합니다. + +```markdown +[Link to a header](#awesome-section) + +[Link to a file](docs/readme) +``` + +절대 경로 링크는 URL이 변경 될 때 마다 변경해야 합니다. (예를 들어 저장소 이름 변경, 유저이름 변경, 프로젝트 포크) +상대 경로 링크를 사용하면 문서를 쉽게 스스로 독립적으로 만들 수 있습니다. + +[*상대 경로 링크에 대해 더 읽어 보세요.*](https://help.github.com/articles/relative-links-in-readmes) + ## .gitconfig Recommendations `.gitconfig`는 모든 설정이 들어있는 파일입니다. @@ -400,6 +487,10 @@ $ git branch --no-merged co = checkout cm = commit p = push + # Show verbose output about tags, branches or remotes + tags = tag -l + branches = branch -a + remotes = remote -v ``` 커맨드 라인에서 다음 명령을 입력합니다. @@ -428,6 +519,9 @@ $ git config alias.ac 'add -A . && 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 remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | ### Auto-correct @@ -464,6 +558,8 @@ $ git comit -m "Message" $ git config --global color.ui 1 ``` +[*깃 `config` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-config) + # Sharing -[트위터](https://twitter.com/intent/tweet?source=webclient&text=http%3A%2F%2Fgit.io%2FvvT17g%20-%20GitHub%20치트%20시트)에 공유하기 +[트위터](https://twitter.com/intent/tweet?source=webclient&text=http%3A%2F%2Fgit.io%2FvvT17g%20-%20깃허브%20치트%20시트)에 공유하기 From 9bab1c407d2a39261efc9ecb88edc6091b5c488a Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 15:34:37 +0100 Subject: [PATCH 028/292] Improve contributing guide --- CONTRIBUTING.md | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62be378..1d049a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,31 +1,16 @@ # Contributing -1. Fork it (http://github.com/tiimgreen/github-cheat-sheet/fork) -2. Commit your changes -3. Push changes -4. Create new Pull Request +1. Fork the repository. +2. Add your section - make sure you follow the [styling](#styling) guide. +3. Commit changes. +4. Push your commit. +5. Create a Pull Request. ## Styling -- Use h2 for header: -``` -## New Feature -``` -- Add new feature in Contents Menu in correct position -- For internal links e.g. Contents use relative links: -``` -- [Ignore Whitespace](#ignore-whitespace) -``` -Not: -``` -- [Ignore Whitespace](https://github.com/tiimgreen/github-cheat-sheet#ignore-whitespace) -``` -- Add examples wherever possible -- Use `bash` styling for all git commands: -```bash -$ git commit -m "Message" -``` - ```bash - $ git commit -m "Message" - ``` -- Add links to Git docs or GitHub docs wherever possible +- Use `##` headers for your sections. +- Also use `##` for categories (these should group together relevant sections) and `###` for subcategories. +- Add a link to your section/category to the contents section (use relative links). +- Make sure to include examples wherever possible (preferably GIFs). +- For command-line examples, wrap your commands in a `bash` code block. Ask [@rafalchmiel](https://github.com/rafalchmiel) or [@tiimgreen](https://github.com/tiimgreen) to take a screenshot (so that it is consistent with the rest) of the output if it has color, etc. +- At the end of your section, add a `Read more about...` link. This should directly link to [Git's](http://git-scm.com/docs) or [GitHub's](https://help.github.com/) documentation. From 554d1a38dcc003d8f88aa4dbebc03d9d8f47efa9 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Mon, 14 Apr 2014 23:53:22 +0900 Subject: [PATCH 029/292] Update to b32ba31 --- README.ko.md | 56 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/README.ko.md b/README.ko.md index d9129e0..315e242 100644 --- a/README.ko.md +++ b/README.ko.md @@ -9,7 +9,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Hub - Git Wrapper](#hub---git-wrapper) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Previous Branch](#previous-branch) -- [git.io](#gitio) +- [Git.io](#gitio) - [Gists](#gists) - [Keyboard Shortcuts](#keyboard-shortcuts) - [Closing Issues with Commits](#closing-issues-with-commits) @@ -21,6 +21,10 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Comparing Branches](#comparing-branches) - [Line Highlighting in Repos](#line-highlighting-in-repos) - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) +- [Diffs](#diffs) + - [Rendered Prose Diffs](#rendered-prose-diffs) + - [Diffable Maps](#diffable-maps) + - [Expanding Context in Diffs](#expanding-context-in-diffs) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) - [Quick Quoting](#quick-quoting) @@ -31,7 +35,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Quick Licensing](#quick-licensing) - [Task Lists](#task-lists) - [Relative Links](#relative-links) -- [.gitconfig Recommendations](#gitconfig-recommendations) +- [`.gitconfig` Recommendations](#gitconfig-recommendations) - [Aliases](#aliases) - [Auto-correct](#auto-correct) - [Color](#color) @@ -74,7 +78,7 @@ $ hub clone tiimgreen/toc 사람들이 사용하고 기여할 수 있는 프로젝트를 만드려면, 가장 기본적인 질문에 대답할 수 있어야합니다. 이 프로젝트는 무엇입니까? 어떻게 사용합니까? 어디까지 허용됩니까? 어떻게 기여합니까? 어떻게 개발하고 실행해야 합니까? 어떻게 새로운 기능이 이전 기능을 손상되지 않았는지 확인해야 합니까? -[Friction](https://github.com/rafalchmiel/friction)은 이러한 일반적인 질문들의 답이 프로젝트 안에 있는지 확인하는 커맨드 라인 스크립트 입니다. 다음은 샘플 출력 입니다. +[Friction](https://github.com/rafalchmiel/friction)은 이러한 일반적인 [질문들의 답](https://github.com/rafalchmiel/friction/wiki)이 프로젝트 안에 있는지 확인하는 커맨드 라인 스크립트 입니다. 다음은 샘플 출력 입니다. [![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) @@ -101,11 +105,19 @@ $ git checkout - [*깃 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) -## git.io +## Git.io -[git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. +[Git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. 순수 HTTP에서 Curl으로 사용하실 수도 있습니다. -[http://git.io/wO0xUg](http://git.io/wO0xUg) +```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) @@ -198,12 +210,14 @@ $ git checkout origin/pr/42 [*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally) -## Cross-link Issues +## Cross-Link Issues 같은 저장소의 다른 이슈를 링크하기 원한다면, `#`뒤에 이슈 번호만 입력하시면 자동으로 링크됩니다. 다른 저장소의 이슈를 링크하고 싶다면 `사람_이름/저장소_이름#이슈_번호`로 할 수 있습니다. (예 `tiimgreen/toc#12`) +![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) + ## Syntax Highlighting in Markdown Files 마크다운에서 예를 들어, 루비 코드를 신텍스 하이라이트 하려면 이렇게 합니다. @@ -308,6 +322,32 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis [*저장소 메타 데이타와 깃허브 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](Repository metadata and plugin support for GitHub Pages) +## Diffs + +### Rendered Prose Diffs + +산문(prose) 파일이 있는 커밋과 풀 리퀘스트는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. "rendered" 버튼을 클릭하시면 렌더된 문서에서 변경을 확인하실 수 있습니다. 렌더된 산문(prose) 뷰는 문장을 추가, 삭제, 변경했을때 유용합니다. + +![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) + +[*렌더된 산문(prose) diff에 대해 더 읽어 보세요.*](https://github.com/blog/1784-rendered-prose-diffs) + +### Diffable Maps + +지오데이타가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 깃허브는 무엇이 변경 되었는지 시각적으로 보여줍니다. + +[![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) + +[*diff 가능한 맵에 대해 더 읽어 보세요.*](https://github.com/blog/1772-diffable-more-customizable-maps) + +### Expanding Context in Diffs + +Using the *unfold* button in the gutter of a diff, you can reveal additional lines of context with a click. You can keep clicking *unfold* until you've revealed the whole file, and the feature is available anywhere GitHub renders diffs. + +![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) + +[*diff에서의 문맥 확장에 대해 더 읽어 보세요.*](https://github.com/blog/1705-expanding-context-in-diffs) + ## Emojis 에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등등에서 `:에모지의_이름:`으로 만들 수 있습니다. @@ -472,7 +512,7 @@ $ git branch --no-merged [*상대 경로 링크에 대해 더 읽어 보세요.*](https://help.github.com/articles/relative-links-in-readmes) -## .gitconfig Recommendations +## `.gitconfig` Recommendations `.gitconfig`는 모든 설정이 들어있는 파일입니다. From 8badd0b4a61b9860c489db00c6cb6525bd8eb15a Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 15:58:17 +0100 Subject: [PATCH 030/292] Search bar -> command bar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ffe6f6..c167dca 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Pressing `t` will bring up a file explorer. Pressing `w` will bring up the branch selector. -Pressing `s` will select the search bar. +Pressing `s` will select the Command Bar. Pressing `l` will edit labels on existing issues. From b9a18b76116fd83c39ca2777763b1b62fa3951c5 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 16:04:36 +0100 Subject: [PATCH 031/292] Add 'Contributing Guidelines' section :feelsgood: --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c167dca..15076d5 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Closing Issues with Commits](#closing-issues-with-commits) - [Checking out Pull Requests](#checking-out-pull-requests) - [Cross-Link Issues](#cross-link-issues) +- [Contributing Guidelines](#contributing-guidelines) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Commit History by Author](#commit-history-by-author) - [Empty Commits](#empty-commits) @@ -217,6 +218,13 @@ To link to an issue in another repo, `user_name/repo_name#ISSUE_NUMBER` e.g. `ti ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) +## Contributing Guidelines +Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. + +![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) + +[*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) + ## Syntax Highlighting in Markdown Files For example, to syntax highlight Ruby code in your Markdown files write: From 2dbc2d3839b89ce6432ceb55db9c1cf0ccce4786 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 16:06:11 +0100 Subject: [PATCH 032/292] :trollface: :trollface: :trollface: --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 15076d5..c5418eb 100644 --- a/README.md +++ b/README.md @@ -261,14 +261,12 @@ https://github.com/rails/rails/commits/master?author=dhh ## Empty Commits -Commits can be pushed with no code changes by adding `--allow-empty` +Commits can be pushed with no code changes by adding `--allow-empty` — :trollface: : ```bash $ git commit -m "Big-ass commit" --allow-empty ``` -![Trololol](http://img1.wikia.nocookie.net/__cb20130905205853/flylikeabird3/images/0/0c/Mexican_troll_face_by_mariodude12312-d5mtl9z.png) - ## Comparing Branches To use GitHub to compare branches, change the URL to look like this: From fea2ee2176414243d3b3a9c0f800cb8086396256 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 16:08:10 +0100 Subject: [PATCH 033/292] Just a little :trollface: --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c5418eb..b2425b2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Contributing Guidelines](#contributing-guidelines) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Commit History by Author](#commit-history-by-author) -- [Empty Commits](#empty-commits) +- [Empty Commits :trollface:](#empty-commits-trollface) - [Comparing Branches](#comparing-branches) - [Line Highlighting in Repos](#line-highlighting-in-repos) - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) @@ -259,9 +259,9 @@ https://github.com/rails/rails/commits/master?author=dhh [*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) -## Empty Commits +## Empty Commits :trollface: -Commits can be pushed with no code changes by adding `--allow-empty` — :trollface: : +Commits can be pushed with no code changes by adding `--allow-empty`: ```bash $ git commit -m "Big-ass commit" --allow-empty From 1356f5e52b8769242501ea013a90a782a4ad3354 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 16:10:28 +0100 Subject: [PATCH 034/292] Make list of emojis prettier --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b2425b2..3e034a1 100644 --- a/README.md +++ b/README.md @@ -365,11 +365,11 @@ The full list of supported Emojis on GitHub can be found [here](http://www.emoji The top 5 used Ejmojis on GitHub are: -1. :shipit: `:shipit:` -2. :sparkles: `:sparkles:` -3. :-1: `:-1:` -4. :+1: `:+1:` -5. :clap: `:clap:` +1. :shipit: - `:shipit:` +2. :sparkles: - `:sparkles:` +3. :-1: - `:-1:` +4. :+1: - `:+1:` +5. :clap: - `:clap:` ## Images/GIFs From b414281c388fdb06bfbbb130a81fe8b9bc29ce94 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 16:21:27 +0100 Subject: [PATCH 035/292] Add info about '.pibb' thanks to @jballanc :heart: --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e034a1..e60eb1a 100644 --- a/README.md +++ b/README.md @@ -123,9 +123,10 @@ Location: https://github.com/... ## Gists -[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repo. +[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repo. 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. + +Gists can be treated as a full repository so they can be cloned like any other: -Although, Gists can be treated as a full repo so they can be cloned like any other: ```bash $ git clone https://gist.github.com/tiimgreen/10545817 ``` From 07792b372366b02f3f26bcd9975e0e6fe5f68eb6 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 16:39:14 +0100 Subject: [PATCH 036/292] Add 'Embedding Images in GitHub Wiki' section thanks to @lelandbatey :cupid: --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index e60eb1a..140a3e2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Cross-Link Issues](#cross-link-issues) - [Contributing Guidelines](#contributing-guidelines) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) +- [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - [Commit History by Author](#commit-history-by-author) - [Empty Commits :trollface:](#empty-commits-trollface) - [Comparing Branches](#comparing-branches) @@ -250,6 +251,27 @@ GitHub uses [Linguist](https://github.com/github/linguist) to perform language d [*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) +## Embedding Images in GitHub Wiki +There are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax: + +```markdown +![Description here](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) +``` + +Which produces: + +![](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) + +But there's also a syntax that allows things like specifying the height or width of the image: + +```markdown +[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] +``` + +Which produces: + +![Just a screenshot](http://i.imgur.com/J5bMf7S.png) + ## Commit History by Author To view all commits on a repo by author add `?author=username` to the URL. From 6f23032f48fde020254446bdf3ead16125af5d47 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 16:50:58 +0100 Subject: [PATCH 037/292] Add wiki images section under images/GIFs --- README.md | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 140a3e2..87de8af 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Cross-Link Issues](#cross-link-issues) - [Contributing Guidelines](#contributing-guidelines) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) -- [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - [Commit History by Author](#commit-history-by-author) - [Empty Commits :trollface:](#empty-commits-trollface) - [Comparing Branches](#comparing-branches) @@ -29,6 +28,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Expanding Context in Diffs](#expanding-context-in-diffs) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) + - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - [Quick Quoting](#quick-quoting) - [Styled Git Status](#styled-git-status) - [Styled Git Log](#styled-git-log) @@ -251,27 +251,6 @@ GitHub uses [Linguist](https://github.com/github/linguist) to perform language d [*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) -## Embedding Images in GitHub Wiki -There are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax: - -```markdown -![Description here](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) -``` - -Which produces: - -![](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) - -But there's also a syntax that allows things like specifying the height or width of the image: - -```markdown -[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] -``` - -Which produces: - -![Just a screenshot](http://i.imgur.com/J5bMf7S.png) - ## Commit History by Author To view all commits on a repo by author add `?author=username` to the URL. @@ -399,13 +378,24 @@ The top 5 used Ejmojis on GitHub are: Images and GIFs can be added to comments, READMEs etc.: ``` -![Alt Text](http://image_url.com/image.jpg) +![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` -![Cat and Rabbit](http://i.imgur.com/PoBmL0W.gif) +![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) All images are cached on GitHub, so if your host goes down, the image will remain available. +### Embedding Images in GitHub Wiki +There are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax (shown above). But there's also a syntax that allows things like specifying the height or width of the image: + +```markdown +[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] +``` + +Which produces: + +![Just a screenshot](http://i.imgur.com/J5bMf7S.png) + ## Quick Quoting When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. From 7780982e28879ea58870f92e1590b3342040dc84 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 14 Apr 2014 17:13:10 +0100 Subject: [PATCH 038/292] Clarify Rendered Prose Diffs --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 87de8af..13b76db 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,11 @@ The Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](h ## Diffs ### Rendered Prose Diffs -Commits and pull requests including prose files feature *source* and *rendered* views. Click the "rendered" button to see the changes as they'll appear in the rendered document. Rendered prose view is handy when you're adding, removing, and editing text: +Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views. + +![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) + +Click the "rendered" button to see the changes as they'll appear in the rendered document. Rendered prose view is handy when you're adding, removing, and editing text: ![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) From 25ac4023b5bcd201ebdc3fce59909b54afb827b7 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 14 Apr 2014 17:27:14 +0100 Subject: [PATCH 039/292] Update intro paragraph --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13b76db..99c9b76 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GitHub Cheat Sheet -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)). +A collection of cool hidden and not so 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)). # Contents From 30b1c87144c12e78613a98efbd6647bceaf81ba6 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 18:58:16 +0100 Subject: [PATCH 040/292] :star: Don't push, I'll be reorganizing the whole file From d94e3c69d69c70d2bc97bceb8332ffdce18b7df9 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 19:49:22 +0100 Subject: [PATCH 041/292] :star2: Organize sections (fixes #21) :star: --- README.md | 605 ++++++++++++++++++++++++++---------------------------- 1 file changed, 289 insertions(+), 316 deletions(-) diff --git a/README.md b/README.md index 99c9b76..6465235 100644 --- a/README.md +++ b/README.md @@ -1,56 +1,65 @@ # GitHub Cheat Sheet - A collection of cool hidden and not so 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)). -# Contents - -- [Ignore Whitespace](#ignore-whitespace) -- [Cloning a Repo](#cloning-a-repo) -- [Hub - Git Wrapper](#hub---git-wrapper) -- [Decreasing Contributor Friction](#decreasing-contributor-friction) -- [Previous Branch](#previous-branch) -- [Git.io](#gitio) -- [Gists](#gists) -- [Keyboard Shortcuts](#keyboard-shortcuts) -- [Closing Issues with Commits](#closing-issues-with-commits) -- [Checking out Pull Requests](#checking-out-pull-requests) -- [Cross-Link Issues](#cross-link-issues) -- [Contributing Guidelines](#contributing-guidelines) -- [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) -- [Commit History by Author](#commit-history-by-author) -- [Empty Commits :trollface:](#empty-commits-trollface) -- [Comparing Branches](#comparing-branches) -- [Line Highlighting in Repos](#line-highlighting-in-repos) -- [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) -- [Diffs](#diffs) - - [Rendered Prose Diffs](#rendered-prose-diffs) - - [Diffable Maps](#diffable-maps) - - [Expanding Context in Diffs](#expanding-context-in-diffs) -- [Emojis](#emojis) -- [Images/GIFs](#imagesgifs) - - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) -- [Quick Quoting](#quick-quoting) -- [Styled Git Status](#styled-git-status) -- [Styled Git Log](#styled-git-log) -- [Git Query](#git-query) -- [Merged Branches](#merged-branches) -- [Quick Licensing](#quick-licensing) -- [Task Lists](#task-lists) -- [Relative Links](#relative-links) -- [`.gitconfig` Recommendations](#gitconfig-recommendations) +## Table of Contents + - [GitHub](#github) + - [Ignore Whitespace](#ignore-whitespace) + - [Commit History by Author](#commit-history-by-author) + - [Cloning a Repository](#cloning-a-repository) + - [Comparing Branches](#comparing-branches) + - [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories) + - [Gists](#gists) + - [Git.io](#gitio) + - [Keyboard Shortcuts](#keyboard-shortcuts) + - [Line Highlighting in Repositories](#line-highlighting-in-repositories) + - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) + - [Cross-Link Issues](#cross-link-issues) + - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) + - [Emojis](#emojis) + - [Images/GIFs](#imagesgifs) + - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) + - [Quick Quoting](#quick-quoting) + - [Quick Licensing](#quick-licensing) + - [Task Lists](#task-lists) + - [Relative Links](#relative-links) + - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) + - [Diffs](#diffs) + - [Rendered prose Diffs](#rendered-prose-diffs) + - [Diffable Maps](#diffable-maps) + - [Expanding Context in Diffs](#expanding-context-in-diffs) + - [Hub](#hub) + - [Decreasing Contributor Friction](#decreasing-contributor-friction) + - [Contributing Guidelines](#contributing-guidelines) + - [Git](#git) + - [Previous Branch](#previous-branch) + - [Checking out Pull Requests](#checking-out-pull-requests) + - [Empty Commits :trollface:](#empty-commits-trollface) + - [Styled Git Status](#styled-git-status) + - [Styled Git Log](#styled-git-log) + - [Git Query](#git-query) + - [Merged Branches](#merged-branches) + - [Git Configurations](#git-configurations) - [Aliases](#aliases) - - [Auto-correct](#auto-correct) + - [Auto-Correct](#auto-correct) - [Color](#color) -## Ignore Whitespace - +## GitHub +### Ignore Whitespace Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed. [*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) -## Cloning a Repo +### Commit History by Author +To view all commits on a repo by author add `?author=username` to the URL. -When cloning a repo the `.git` can be left off the end. +``` +https://github.com/rails/rails/commits/master?author=dhh +``` + +[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) + +### Cloning a Repository +When cloning a repository the `.git` can be left off the end. ```bash $ git clone https://github.com/tiimgreen/github-cheat-sheet @@ -58,56 +67,58 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*Read more about the Git `clone` command.*](http://git-scm.com/docs/git-clone) -## Hub - Git Wrapper +### Comparing Branches +To use GitHub to compare branches, change the URL to look like this: -[Hub](https://github.com/github/hub) is a command line git wrapper that gives extra features and commands that make working with GitHub easier. +``` +https://github.com/user/repo/compare/{range} +``` -This allows you to do things like: +Where `{range} = master...4-1-stable` -```bash -$ hub clone tiimgreen/toc +For example: +``` +https://github.com/rails/rails/compare/master...4-1-stable ``` -instead of: +`{range}` can be changed to things like: -```bash -$ git clone https://github.com/tiimgreen/toc.git +``` +https://github.com/rails/rails/compare/master@{1.day.ago}...master +https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` -[*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) - -## Decreasing Contributor Friction -If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? +...which allows you to see the difference on the master branch up a set time ago or a specified date. -[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common [answers to these questions](https://github.com/rafalchmiel/friction/wiki). This is some example output: +[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) -[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) +### Compare Branches across Forked Repositories +To use GitHub to compare branches across forked repositories, change the URL to look like this: -## Previous Branch +``` +https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +``` -To move to the previous directory in the command line: +For example: -```bash -$ cd - +``` +https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master ``` -Similarly, to move to the last branch in git: +### Gists +[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. -```bash -$ git checkout - -# Switched to branch 'master' - -$ git checkout - -# Switched to branch 'next' +Gists can be treated as a full repository so they can be cloned like any other: -$ git checkout - -# Switched to branch 'master' +```bash +$ git clone https://gist.github.com/tiimgreen/10545817 ``` -[*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) +![Gists](http://i.imgur.com/dULZXXo.png) -## Git.io +[*Read more about creating gists.*](https://help.github.com/articles/creating-gists) +### Git.io [Git.io](http://git.io) is a simple URL shortener for GitHub. You can also use it via pure HTTP using Curl: ```bash @@ -122,113 +133,51 @@ Location: https://github.com/... [*Read more about Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) -## Gists - -[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repo. 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. - -Gists can be treated as a full repository so they can be cloned like any other: - -```bash -$ git clone https://gist.github.com/tiimgreen/10545817 -``` - -![Gists](http://i.imgur.com/dULZXXo.png) - -[*Read more about creating gists.*](https://help.github.com/articles/creating-gists) - -## Keyboard Shortcuts - -When on a repo page keyboard shortcuts allow you to navigate easily. - -Pressing `t` will bring up a file explorer. +### Keyboard Shortcuts +When on a repository page, keyboard shortcuts allow you to navigate easily. -Pressing `w` will bring up the branch selector. - -Pressing `s` will select the Command Bar. - -Pressing `l` will edit labels on existing issues. - -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. + - Pressing `t` will bring up a file explorer. + - Pressing `w` will bring up the branch selector. + - Pressing `s` will select the Command Bar. + - Pressing `l` will edit labels on existing Issues. + - 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. To see all of the shortcuts for the current page press `?`. [*Read more about using the Command Bar.*](https://help.github.com/articles/using-the-command-bar) -## Closing Issues with Commits - -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 once it is committed to the master branch. - -```bash -$ git commit -m "Fix cock up, fixes #12" -``` - -This closes the issue and references the closing commit. - -![Closing Repo](http://i.imgur.com/URXFprQ.png) - -[*Read more about closing issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) - -## Checking out Pull Requests +### Line Highlighting in Repositories +Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. -If you want to check out pull request locally, you can fetch it using that command: +It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines: -```bash -$ git fetch origin '+refs/pull/*/head:refs/pull/*' ``` - -then, checkout Pull Request (i.e. 42) using - -```bash -$ git checkout refs/pull/42 +https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 ``` -Alternatively, you can fetch them as remote branches: - -```bash -$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' -``` +![Line Highlighting](http://i.imgur.com/8AhjrCz.png) -and checkout as: +### Closing Issues via Commit Messages +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 once it is committed to the master branch. ```bash -$ git checkout origin/pr/42 -``` - -and even fetch them automatically, if you add corresponding lines in your .git/config: - - -``` -[remote "origin"] - fetch = +refs/heads/*:refs/remotes/origin/* - url = git@github.com:tiimgreen/github-cheat-sheet.git +$ git commit -m "Fix cock up, fixes #12" ``` -``` -[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/* -``` +This closes the issue and references the closing commit. -[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) +![Closing Repo](http://i.imgur.com/URXFprQ.png) -## Cross-Link Issues +[*Read more about closing Issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) -If you want to link to another issue in the same repo, simple type hash `#` then the issue number, it will be auto-linked. +### Cross-Link Issues +If you want to link to another issue in the same repository, simple type hash `#` then the issue number, it will be auto-linked. -To link to an issue in another repo, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. +To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) -## Contributing Guidelines -Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. - -![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) - -[*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) - -## Syntax Highlighting in Markdown Files - +### Syntax Highlighting in Markdown Files For example, to syntax highlight Ruby code in your Markdown files write: ```ruby @@ -251,82 +200,111 @@ GitHub uses [Linguist](https://github.com/github/linguist) to perform language d [*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) -## Commit History by Author - -To view all commits on a repo by author add `?author=username` to the URL. +### Emojis +Emojis can added to on Pull Requests, Issues, commit messages, Markdown files, etc. using `:name_of_emoji:`: ``` -https://github.com/rails/rails/commits/master?author=dhh +:smile: ``` -[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) +Would produce: -## Empty Commits :trollface: +:smile: -Commits can be pushed with no code changes by adding `--allow-empty`: +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). -```bash -$ git commit -m "Big-ass commit" --allow-empty -``` +The top 5 used Ejmojis on GitHub are: -## Comparing Branches +1. :shipit: - `:shipit:` +2. :sparkles: - `:sparkles:` +3. :-1: - `:-1:` +4. :+1: - `:+1:` +5. :clap: - `:clap:` -To use GitHub to compare branches, change the URL to look like this: +### Images/GIFs +Images and GIFs can be added to comments, READMEs etc.: ``` -https://github.com/user/repo/compare/{range} +![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` -Where `{range} = master...4-1-stable` +![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) -e.g.: -``` -https://github.com/rails/rails/compare/master...4-1-stable -``` +All images are cached on GitHub, so if your host goes down, the image will remain available. -`{range}` can be changed to things like: -``` -https://github.com/rails/rails/compare/master@{1.day.ago}...master -https://github.com/rails/rails/compare/master@{2014-10-04}...master +#### Embedding Images in GitHub Wiki +There are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax (shown above). But there's also a syntax that allows things like specifying the height or width of the image: + +```markdown +[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] ``` -which allows you to see the difference on the master branch up a set time ago or a specified date. -[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) +Which produces: -### Compare branches across forked repositories +![Just a screenshot](http://i.imgur.com/J5bMf7S.png) -To use GitHub to compare branches across forked repositories, change the URL to look like this: +### Quick Quoting +When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. + +![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) + +[*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) + +### Quick Licensing +When creating a repository GitHub gives you the options of adding in a pre-made license: + +![Licese](http://i.imgur.com/Chqj4Fg.png) + +You can also add them to existing repositories by creating a new file through the web interface. When the name `LICENSE` is typed in you will get an option to use a template: + +![License](http://i.imgur.com/fTjQict.png) + +Also works for `.gitignore`. + +[*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing) + +### Task Lists +In Issues and Pull requests check boxes can be added with the following syntax (notice the space): ``` -https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +- [ ] Be awesome +- [ ] Do stuff +- [ ] Sleep ``` -eg.: +![Task List](http://i.imgur.com/k2qZi56.png) + +When they are clicked, they will be updated in the pure Markdown: + ``` -https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master +- [x] Be awesome +- [x] Do stuff +- [ ] Sleep ``` -## Line Highlighting in Repos - -Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. +[*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) -It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines: +### Relative Links +Relative links are recommended in your Markdown files when linking to internal content. -``` -https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 +```markdown +[Link to a header](#awesome-section) +[Link to a file](docs/readme) ``` -![Line Highlighting](http://i.imgur.com/8AhjrCz.png) +Absolute links have to be updated whenever the URL changes (e.g. repository renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own. + +[*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes) -## Metadata and Plugin Support for GitHub Pages +### Metadata and Plugin Support for GitHub Pages Within Jekyll pages and posts, repository information is available within the `site.github` namespace, and can be displayed, for example, using `{{ site.github.project_title }}`. 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. [*Read more about repository metadata and plugin support for GitHub Pages.*](Repository metadata and plugin support for GitHub Pages) -## Diffs -### Rendered Prose Diffs +### Diffs +#### Rendered Prose Diffs Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views. ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) @@ -337,110 +315,158 @@ Click the "rendered" button to see the changes as they'll appear in the rendered [*Read more about rendered prose diffs.*](https://github.com/blog/1784-rendered-prose-diffs) -### Diffable Maps +#### Diffable Maps Any time you view a commit or pull request on GitHub that includes geodata, GitHub will render a visual representation of what was changed. [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) [*Read more about diffable maps.*](https://github.com/blog/1772-diffable-more-customizable-maps) -### Expanding Context in Diffs +#### Expanding Context in Diffs Using the *unfold* button in the gutter of a diff, you can reveal additional lines of context with a click. You can keep clicking *unfold* until you've revealed the whole file, and the feature is available anywhere GitHub renders diffs. ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) [*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs) -## Emojis +### Hub +[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. -Emojis can be generated on Pull Requests, Issues, Commit Messages, READMEs, etc. using `:name_of_emoji:` +This allows you to do things like: +```bash +$ hub clone tiimgreen/toc ``` -:smile: -:poop: -:shipit: -:+1: + +...instead of: + +```bash +$ git clone https://github.com/tiimgreen/toc.git ``` -:smile: -:poop: -:shipit: -:+1: +[*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) -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). +### Decreasing Contributor Friction +If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? -The top 5 used Ejmojis on GitHub are: +[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common [answers to these questions](https://github.com/rafalchmiel/friction/wiki). This is some example output: -1. :shipit: - `:shipit:` -2. :sparkles: - `:sparkles:` -3. :-1: - `:-1:` -4. :+1: - `:+1:` -5. :clap: - `:clap:` +[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) + +### Contributing Guidelines +Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. -## Images/GIFs +![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) -Images and GIFs can be added to comments, READMEs etc.: +[*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) + +## Git +### Previous Branch +To move to the previous branch in Git: +```bash +$ git checkout - +# Switched to branch 'master' + +$ git checkout - +# Switched to branch 'next' + +$ git checkout - +# Switched to branch 'master' ``` -![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) + +[*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) + +### Checking out Pull Requests +If you want to check out pull request locally, you can fetch it using that command: + +```bash +$ git fetch origin '+refs/pull/*/head:refs/pull/*' ``` -![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) +then, checkout Pull Request (i.e. 42) using -All images are cached on GitHub, so if your host goes down, the image will remain available. +```bash +$ git checkout refs/pull/42 +``` -### Embedding Images in GitHub Wiki -There are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax (shown above). But there's also a syntax that allows things like specifying the height or width of the image: +Alternatively, you can fetch them as remote branches: -```markdown -[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] +```bash +$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' ``` -Which produces: +and checkout as: -![Just a screenshot](http://i.imgur.com/J5bMf7S.png) +```bash +$ git checkout origin/pr/42 +``` -## Quick Quoting +and even fetch them automatically, if you add corresponding lines in your .git/config: -When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. -![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) +``` +[remote "origin"] + fetch = +refs/heads/*:refs/remotes/origin/* + url = git@github.com:tiimgreen/github-cheat-sheet.git +``` -[*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) +``` +[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/* +``` + +[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) -## Styled Git Status +### Empty Commits :trollface: +Commits can be pushed with no code changes by adding `--allow-empty`: + +```bash +$ git commit -m "Big-ass commit" --allow-empty +``` + +### Styled Git Status +Running: ```bash $ git status ``` +Produces: + ![git status](http://i.imgur.com/o3PEHAA.png) -Can be changed to: +By adding `-sb`: ```bash $ git status -sb ``` +This is produced: + ![git status -sb](http://i.imgur.com/xNI1bT0.png) [*Read more about the Git `status` command.*](http://git-scm.com/docs/git-status) -## Styled Git Log +### Styled Git Log +Running: ```bash $ git log --all --graph --decorate --oneline --abbrev-commit ``` +Produces: + ![git log --all --graph --decorate --oneline --abbrev-commit](http://i.imgur.com/RUPycwI.png) -NOTE: This can be added into an Alias (shorter command) using the instructions [here](https://github.com/tiimgreen/github-cheat-sheet#aliases) +*This can be aliased using the instructions found [here](https://github.com/tiimgreen/github-cheat-sheet#aliases).* [*Read more about the Git `log` command.*](http://git-scm.com/docs/git-log) -## Git Query - -A git query allows you to search all your previous commit messages and finds the most recent one matching the query. +### Git Query +A Git query allows you to search all your previous commit messages and find the most recent one matching the query. ```bash $ git show :/query @@ -453,9 +479,10 @@ $ git show :/typo ``` ![git show :/query](http://i.imgur.com/icaGiNt.png) -NOTE: Press `q` to quit. +*Press `q` to quit.* -## Merged Branches +### Merged Branches +Running: ```bash $ git branch --merged @@ -473,95 +500,46 @@ Will give you a list of branches that have not been merged into your current bra [*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch) -## Quick Licensing - -When creating a repo GitHub gives you the options of adding in a pre-made license: - -![Licese](http://i.imgur.com/Chqj4Fg.png) - -You can also add them to existing repos by creating a new file through the web interface. When the name `LICENSE` is typed in you will get an option to use a template: - -![License](http://i.imgur.com/fTjQict.png) - -Also works for `.gitignore`. - -[*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing) - -## Task Lists - -In Issues and Pull requests check boxes can be added with the following syntax (notice the space): -``` -- [ ] Be awesome -- [ ] Do stuff -- [ ] Sleep -``` - -![Task List](http://i.imgur.com/k2qZi56.png) - -When they are clicked, they will be updated in the pure Markdown: - -``` -- [x] Be awesome -- [x] Do stuff -- [ ] Sleep -``` - -[*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) - -## Relative Links - -Relative links are recommended in your Markdown files when linking to internal content. - -```markdown -[Link to a header](#awesome-section) - -[Link to a file](docs/readme) -``` - -Absolute links have to be updated whenever the URL changes (e.g. repo renamed, username changed, project forked). -Using relative links makes your documentation easily stand on its own. - -[*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes) - -## `.gitconfig` Recommendations - -Your `.gitconfig` is the file that contains all your preferences. - -### Aliases +### Git Configurations +Your `.gitconfig` file contains all your Git configurations. +#### Aliases Aliases are helpers that let you define your own git calls. For example you could set `git a` to run `git add --all`. To add an alias, either navigate to `~/.gitconfig` and fill it out in the following format: ``` [alias] - co = checkout - cm = commit - p = push - # Show verbose output about tags, branches or remotes - tags = tag -l - branches = branch -a - remotes = remote -v + co = checkout + cm = commit + p = push + # Show verbose output about tags, branches or remotes + tags = tag -l + branches = branch -a + remotes = remote -v ``` -or type in the command line: +...or type in the command-line: ```bash $ git config alias.new_alias git_function ``` -e.g. + +For example: + ```bash $ git config alias.cm commit ``` -NOTE: for an alias with multiple functions use quotes: +For an alias with multiple functions use quotes: + ```bash $ git config alias.ac 'add -A . && commit' ``` -Some recommendations include: +Some useful aliases include: -| Alias | Current Command | What to Type | +| Alias | Command | What to Type | | --- | --- | --- | | `git cm` | `git commit` | `git config --global alias.cm commit` | | `git co` | `git checkout` | `git config --global alias.co checkout` | @@ -571,24 +549,24 @@ Some recommendations include: | `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` | | `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | -### Auto-correct +#### Auto-Correct +If you type `git comit` you will get this: -Currently if you type `git comit` you will get this result: ```bash $ git comit -m "Message" # git: 'comit' is not a git command. See 'git --help'. # Did you mean this? -# commit +# commit ``` -To call `commit` when `comit` is typed, just enable autocorrect: +To call `commit` when `comit` is typed, just enable auto-correct: ```bash $ git config --global help.autocorrect 1 ``` -So now you will get this result: +So now you will get this: ```bash $ git comit -m "Message" @@ -597,16 +575,11 @@ $ git comit -m "Message" # in 0.1 seconds automatically... ``` -### Color - -To add more colour to your git command line: +#### Color +To add more color to your Git output: ```bash $ git config --global color.ui 1 ``` [*Read more about the Git `config` command.*](http://git-scm.com/docs/git-config) - -# Sharing - -Share on [Twitter](https://twitter.com/intent/tweet?source=webclient&text=http%3A%2F%2Fgithub.com%2Ftiimgreen%2Fgithub-cheat-sheet%20-%20GitHub%20Cheat%20Sheet) From e4b415249a354e61eab9954165d360e1b7394880 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 19:51:06 +0100 Subject: [PATCH 042/292] Update contributing guide to fit new organization --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d049a8..49f87d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,8 +8,8 @@ ## Styling -- Use `##` headers for your sections. -- Also use `##` for categories (these should group together relevant sections) and `###` for subcategories. +- Use `###` headers for your sections. +- Also use `###` for categories (these should group together relevant sections) and `####` for subcategories. - Add a link to your section/category to the contents section (use relative links). - Make sure to include examples wherever possible (preferably GIFs). - For command-line examples, wrap your commands in a `bash` code block. Ask [@rafalchmiel](https://github.com/rafalchmiel) or [@tiimgreen](https://github.com/tiimgreen) to take a screenshot (so that it is consistent with the rest) of the output if it has color, etc. From 25de4b55638d0143c4ca3a9b0e6173665f7a0505 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 19:53:59 +0100 Subject: [PATCH 043/292] Add 'Git' to title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6465235..22718c6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# GitHub Cheat Sheet +# Git + GitHub Cheat Sheet A collection of cool hidden and not so 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)). ## Table of Contents From a657ee11c5fdf22de2ef5ba44931310ae5b24b2d Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 14 Apr 2014 19:56:01 +0100 Subject: [PATCH 044/292] Revert title back to original --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22718c6..6465235 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Git + GitHub Cheat Sheet +# GitHub Cheat Sheet A collection of cool hidden and not so 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)). ## Table of Contents From c492824fa510a8b36f8141d272af45ca087cf270 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 20:04:18 +0100 Subject: [PATCH 045/292] Add use-cases for empty commits, thanks to @davej :yellow_heart: --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6465235..3821e1f 100644 --- a/README.md +++ b/README.md @@ -427,6 +427,12 @@ Commits can be pushed with no code changes by adding `--allow-empty`: $ git commit -m "Big-ass commit" --allow-empty ``` +Some use-cases for this (that make sense), include: + + - Annotating the start of a new bulk of work or a new feature. + - Documenting when you make changes to the project that aren't code related. + - Communicating with people using your repository. + ### Styled Git Status Running: From e81076bd268a8ba66686c1e041ad4dbc89adfe8b Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Mon, 14 Apr 2014 20:13:52 +0100 Subject: [PATCH 046/292] Add section about Git's instaweb command, thanks to @jdkanani :heart: --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3821e1f..eb15621 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) - [Merged Branches](#merged-branches) + - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) - [Git Configurations](#git-configurations) - [Aliases](#aliases) - [Auto-Correct](#auto-correct) @@ -506,6 +507,19 @@ Will give you a list of branches that have not been merged into your current bra [*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch) +### Web Server for Browsing Local Repositories +Use the Git `instaweb` command to instantly browse your working repository in `gitweb`. This command is a simple script to set up `gitweb` and a web server for browsing the local repository. + +```bash +$ git instaweb +``` + +Opens: + +![Git instaweb](http://i.imgur.com/Dxekmqc.png) + +[*Read more about the Git `instaweb` command.*](http://git-scm.com/docs/git-instaweb) + ### Git Configurations Your `.gitconfig` file contains all your Git configurations. From 07c232e8b58743a14fbb44968aa7be4b80e01e2e Mon Sep 17 00:00:00 2001 From: Ruslan Brest Date: Tue, 15 Apr 2014 10:11:20 +0300 Subject: [PATCH 047/292] fix typo Licese -> License --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb15621..172bbe7 100644 --- a/README.md +++ b/README.md @@ -254,7 +254,7 @@ When on a comment thread and you want to quote something someone previously said ### Quick Licensing When creating a repository GitHub gives you the options of adding in a pre-made license: -![Licese](http://i.imgur.com/Chqj4Fg.png) +![License](http://i.imgur.com/Chqj4Fg.png) You can also add them to existing repositories by creating a new file through the web interface. When the name `LICENSE` is typed in you will get an option to use a template: From a347b2385769e1469b0dc8d5a1c9c3b14f6a8711 Mon Sep 17 00:00:00 2001 From: Ruslan Brest Date: Tue, 15 Apr 2014 10:27:54 +0300 Subject: [PATCH 048/292] Getting content of Pull Request in Diff or Patch format --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index eb15621..2b456f9 100644 --- a/README.md +++ b/README.md @@ -330,6 +330,18 @@ Using the *unfold* button in the gutter of a diff, you can reveal additional lin [*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs) +#### Getting content of Pull Request in Diff or Patch format + +You can get the diff of viewed pull request by adding `.diff` or `.patch` +to the end of URL. For example: + +* +* - the pull + request in DIFF format +* - the pull + request as PATCH + + ### Hub [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. From 2e4446fb6e634c9a2d92c89eba7740e523920588 Mon Sep 17 00:00:00 2001 From: Ruslan Brest Date: Tue, 15 Apr 2014 10:38:27 +0300 Subject: [PATCH 049/292] Add ToC entry for Getting content of Pull Request in Diff or Patch format --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2b456f9..13a0481 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Rendered prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) - [Expanding Context in Diffs](#expanding-context-in-diffs) + - [Getting content of Pull Request in Diff or Patch format](#getting-content-of-pull-request-in-diff-or-patch-format) - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) From 10a075f664e2c179862e1f8c94207450b07e0ac2 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Tue, 15 Apr 2014 16:23:45 +0900 Subject: [PATCH 050/292] Update to e81076bd26 --- README.ko.md | 561 ++++++++++++++++++++++++++++----------------------- 1 file changed, 303 insertions(+), 258 deletions(-) diff --git a/README.ko.md b/README.ko.md index 315e242..0e50b54 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,52 +1,70 @@ # 깃허브 치트 시트 -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)). +A collection of cool hidden and not so 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)). # 목록 -- [Ignore Whitespace](#ignore-whitespace) -- [Cloning a Repo](#cloning-a-repo) -- [Hub - Git Wrapper](#hub---git-wrapper) -- [Decreasing Contributor Friction](#decreasing-contributor-friction) -- [Previous Branch](#previous-branch) -- [Git.io](#gitio) -- [Gists](#gists) -- [Keyboard Shortcuts](#keyboard-shortcuts) -- [Closing Issues with Commits](#closing-issues-with-commits) -- [Checking out Pull Requests](#checking-out-pull-requests) -- [Cross-Link Issues](#cross-link-issues) -- [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) -- [Commit History by Author](#commit-history-by-author) -- [Empty Commits](#empty-commits) -- [Comparing Branches](#comparing-branches) -- [Line Highlighting in Repos](#line-highlighting-in-repos) -- [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) -- [Diffs](#diffs) - - [Rendered Prose Diffs](#rendered-prose-diffs) - - [Diffable Maps](#diffable-maps) - - [Expanding Context in Diffs](#expanding-context-in-diffs) -- [Emojis](#emojis) -- [Images/GIFs](#imagesgifs) -- [Quick Quoting](#quick-quoting) -- [Styled Git Status](#styled-git-status) -- [Styled Git Log](#styled-git-log) -- [Git Query](#git-query) -- [Merged Branches](#merged-branches) -- [Quick Licensing](#quick-licensing) -- [Task Lists](#task-lists) -- [Relative Links](#relative-links) -- [`.gitconfig` Recommendations](#gitconfig-recommendations) + - [GitHub](#github) + - [Ignore Whitespace](#ignore-whitespace) + - [Commit History by Author](#commit-history-by-author) + - [Cloning a Repository](#cloning-a-repository) + - [Comparing Branches](#comparing-branches) + - [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories) + - [Gists](#gists) + - [Git.io](#gitio) + - [Keyboard Shortcuts](#keyboard-shortcuts) + - [Line Highlighting in Repositories](#line-highlighting-in-repositories) + - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) + - [Cross-Link Issues](#cross-link-issues) + - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) + - [Emojis](#emojis) + - [Images/GIFs](#imagesgifs) + - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) + - [Quick Quoting](#quick-quoting) + - [Quick Licensing](#quick-licensing) + - [Task Lists](#task-lists) + - [Relative Links](#relative-links) + - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) + - [Diffs](#diffs) + - [Rendered prose Diffs](#rendered-prose-diffs) + - [Diffable Maps](#diffable-maps) + - [Expanding Context in Diffs](#expanding-context-in-diffs) + - [Hub](#hub) + - [Decreasing Contributor Friction](#decreasing-contributor-friction) + - [Contributing Guidelines](#contributing-guidelines) + - [Git](#git) + - [Previous Branch](#previous-branch) + - [Checking out Pull Requests](#checking-out-pull-requests) + - [Empty Commits :trollface:](#empty-commits-trollface) + - [Styled Git Status](#styled-git-status) + - [Styled Git Log](#styled-git-log) + - [Git Query](#git-query) + - [Merged Branches](#merged-branches) + - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) + - [Git Configurations](#git-configurations) - [Aliases](#aliases) - - [Auto-correct](#auto-correct) + - [Auto-Correct](#auto-correct) - [Color](#color) -## Ignore Whitespace +## GitHub + +### Ignore Whitespace `?w=1`를 diff URL에 추가하면 변경된 코드만 볼 수 있도록, 공백만 바뀐 수정을 제거할 수 있습니다. [*깃허브의 비밀을 더 읽어 보세요.*](https://github.com/blog/967-github-secrets) -## Cloning a Repo +### Commit History by Author + +특정 커미터가 한 모든 커밋을 보고 싶다면 URL에 `?author=username`를 추가하세요. + +``` +https://github.com/rails/rails/commits/master?author=dhh +``` + +[*커밋 뷰간의 차이에 대해 더 읽어보세요.*](https://help.github.com/articles/differences-between-commit-views) + +### Cloning a Repository 저장소를 클론할 때, 맨 뒤의 `.git`은 생략할 수 있습니다. @@ -56,56 +74,61 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*깃 `clone` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-clone) -## Hub - Git Wrapper - -[Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. +### Comparing Branches -이런 명령 대신에 +깃허브에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세요. -```bash -$ git clone https://github.com/tiimgreen/toc.git +``` +https://github.com/user/repo/compare/{range} ``` -이렇게 할 수 있습니다. +`{range}`는 `master...4-1-stable`식으로 적습니다. -```bash -$ hub clone tiimgreen/toc +예를 들어: +``` +https://github.com/rails/rails/compare/master...4-1-stable ``` -[*Hub가 제공하는 더 멋진 기능들을 확인해 보세요.*](https://github.com/github/hub#commands) +`{range}` 는 이렇게 적을 수도 있습니다. -## Decreasing Contributor Friction +``` +https://github.com/rails/rails/compare/master@{1.day.ago}...master +https://github.com/rails/rails/compare/master@{2014-10-04}...master +``` -사람들이 사용하고 기여할 수 있는 프로젝트를 만드려면, 가장 기본적인 질문에 대답할 수 있어야합니다. 이 프로젝트는 무엇입니까? 어떻게 사용합니까? 어디까지 허용됩니까? 어떻게 기여합니까? 어떻게 개발하고 실행해야 합니까? 어떻게 새로운 기능이 이전 기능을 손상되지 않았는지 확인해야 합니까? +이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다. -[Friction](https://github.com/rafalchmiel/friction)은 이러한 일반적인 [질문들의 답](https://github.com/rafalchmiel/friction/wiki)이 프로젝트 안에 있는지 확인하는 커맨드 라인 스크립트 입니다. 다음은 샘플 출력 입니다. +[*시간으로 커밋을 비교하는 법에 대해 더 읽어 보세요.*](https://help.github.com/articles/comparing-commits-across-time) -[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) +### Compare branches across forked repositories -## Previous Branch +포크된 저장소간의 브랜치를 비교하려면 URL을 이렇게 변경하세요. -커맨드 라인에서 이전 디렉터리로 이동하려면 이렇게 합니다. +``` +https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +``` -```bash -$ cd - +예를 들면 + +``` +https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master ``` -비슷하게, 깃에서 마지막 브랜치로 돌아가는 건 이렇게 할 수 있습니다. +### Gists -```bash -$ git checkout - -# Switched to branch 'master' +[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. [이렇게](https://gist.github.com/tiimgreen/10545817.pibb) Gist URL뒤에 `.pibb`를 넣으면 다른 사이트에 넣을수 있는 *HTML 온리* 버전을 넣을 수 있습니다. -$ git checkout - -# Switched to branch 'next' +Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다. -$ git checkout - -# Switched to branch 'master' +```bash +$ git clone https://gist.github.com/tiimgreen/10545817 ``` -[*깃 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) +![Gists](http://i.imgur.com/dULZXXo.png) -## Git.io +[*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) + +### Git.io [Git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. 순수 HTTP에서 Curl으로 사용하실 수도 있습니다. @@ -121,96 +144,47 @@ Location: https://github.com/... [*Git.io에 대해 더 읽어 보세요.*](https://github.com/blog/985-git-io-github-url-shortener) -## Gists - -[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. - -쉬운 방법이긴 하지만, Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다. - -```bash -$ git clone https://gist.github.com/tiimgreen/10545817 -``` - -![Gists](http://i.imgur.com/dULZXXo.png) - -[*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) - -## Keyboard Shortcuts +### Keyboard Shortcuts 저장소 페이지에서 단축키를 사용하면 쉽게 이동할 수 있습니다. -`t`를 누르면 파일 탐색 페이지로 이동합니다. - -`w`를 누르면 브렌치 선택 페이지로 이동합니다. - -`s`를 누르면 검색 창으로 이동합니다. - -`l`를 누르면 있는 이슈의 라벨을 수정할 수 있습니다. - -__파일을 보고 있을 때__ (예를 들어 `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`) `y`를 누르면 URL을 지금 보고 있는 페이지를 사실상 고정하도록 합니다. 코드가 바뀐다고 해도 이번에 본 내용을 다시 볼 수 있습니다. + - `t`를 누르면 파일 탐색 페이지로 이동합니다. + - `w`를 누르면 브렌치 선택 페이지로 이동합니다. + - `s`를 누르면 커맨드 창으로 이동합니다. + - `l`를 누르면 있는 이슈의 라벨을 수정할 수 있습니다. + - __파일을 보고 있을 때__ (예를 들어 `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`) `y`를 누르면 URL을 지금 보고 있는 페이지를 사실상 고정하도록 합니다. 코드가 바뀐다고 해도 이번에 본 내용을 다시 볼 수 있습니다. 지금 페이지에서 쓸 수 있는 모든 단축키를 보시려면 `?`를 누르세요. [*커맨드 바의 사용법을 더 읽어 보세요.*](https://help.github.com/articles/using-the-command-bar) -## Closing Issues with Commits - -어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`나 `close/closes/closed`를 키워드로 해당 이슈가 마스터 브랜치에 커밋 될 때 닫을 수 있습니다. - -```bash -$ git commit -m "Fix cock up, fixes #12" -``` - -이렇게 하면 이슈를 닫고 클로징 커맨트로 참조하게 합니다. +### Line Highlighting in Repos -![Closing Repo](http://i.imgur.com/URXFprQ.png) - -[*커밋 메세지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages) - -## Checking out Pull Requests +코드 파일 URL의 끝에 `#L52`를 추가하거나 줄 번호를 클릭하면 그 줄 번호를 하이라이트합니다. -풀 리퀘스트를 체크아웃하려면, 다음 명령어로 가져올 수 있습니다. +`#L53-L60`처럼 범위지정도 가능합니다. 범위를 지정하려면 `shift`키를 누른 채 두 라인을 클릭하면 됩니다. -```bash -$ git fetch origin '+refs/pull/*/head:refs/pull/*' ``` - -그리고 다음 명령을 사용해 풀 리퀘스트(예를 들어 42라면)를 체크아웃합니다. - -```bash -$ git checkout refs/pull/42 +https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 ``` -아니면, 리모트 브랜치에서 가져올 수도 있습니다. +![Line Highlighting](http://i.imgur.com/8AhjrCz.png) -```bash -$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' -``` +### Closing Issues with Commits -그리고 체크아웃은 이렇게 합니다. +어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`나 `close/closes/closed`를 키워드로 해당 이슈가 마스터 브랜치에 커밋 될 때 닫을 수 있습니다. ```bash -$ git checkout origin/pr/42 +$ git commit -m "Fix cock up, fixes #12" ``` -그리고 밑의 줄을 .git/config에 추가하면, 자동으로 가져오게도 할 수 있습니다. - -``` -[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/* -``` +![Closing Repo](http://i.imgur.com/URXFprQ.png) -[*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally) +[*커밋 메세지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages) -## Cross-Link Issues +### Cross-Link Issues 같은 저장소의 다른 이슈를 링크하기 원한다면, `#`뒤에 이슈 번호만 입력하시면 자동으로 링크됩니다. @@ -218,7 +192,7 @@ $ git checkout origin/pr/42 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) -## Syntax Highlighting in Markdown Files +### Syntax Highlighting in Markdown Files 마크다운에서 예를 들어, 루비 코드를 신텍스 하이라이트 하려면 이렇게 합니다. @@ -242,79 +216,117 @@ puts table.to_s [*깃허브 Flavored 마크다운에 대해 더 읽어 보세요.*](https://help.github.com/articles/github-flavored-markdown) -## Commit History by Author +### Emojis -특정 커미터가 한 모든 커밋을 보고 싶다면 URL에 `?author=username`를 추가하세요. +에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등등에서 `:에모지의_이름:`으로 만들 수 있습니다. ``` -https://github.com/rails/rails/commits/master?author=dhh +:smile: +:poop: +:shipit: +:+1: ``` -[*커밋 뷰간의 차이에 대해 더 읽어보세요.*](https://help.github.com/articles/differences-between-commit-views) - -## Empty Commits +:smile: +:poop: +:shipit: +:+1: -`--allow-empty`를 추가하시면 코드의 변경 없이 커밋을 넣을 수 있습니다. +깃허브에서 사용 가능한 에모지의 전 목록은 [여기](http://www.emoji-cheat-sheet.com/) 나 [여기](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. -```bash -$ git commit -m "Big-ass commit" --allow-empty -``` +깃허브에서 많이 사용하는 에모지 탑 5위는 이렇습니다. -![Trololol](http://img1.wikia.nocookie.net/__cb20130905205853/flylikeabird3/images/0/0c/Mexican_troll_face_by_mariodude12312-d5mtl9z.png) +1. :shipit: - `:shipit:` +2. :sparkles: - `:sparkles:` +3. :-1: - `:-1:` +4. :+1: - `:+1:` +5. :clap: - `:clap:` -## Comparing Branches +### Images/GIFs -깃허브에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세요. +커맨트나 README등등에 이미지와 GIF를 넣을 수 있습니다. ``` -https://github.com/user/repo/compare/{range} +![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` -`{range}`는 `master...4-1-stable`식으로 적습니다. +![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) -예를 들어: -``` -https://github.com/rails/rails/compare/master...4-1-stable -``` +모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다. -`{range}` 는 이렇게 적을 수도 있습니다. +#### Embedding Images in GitHub Wiki -``` -https://github.com/rails/rails/compare/master@{1.day.ago}...master -https://github.com/rails/rails/compare/master@{2014-10-04}...master +이미지를 위키 페이지ㅇ넣는 방법은 여럿 있습니다. 위에 보이는 일반 마크다운 문법도 있지만, 이미지에 높이와 넓이를 지정할 수 있는 문법도 있습니다. + +```markdown +[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] ``` -이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다. +이렇게 보입니다. -[*시간으로 커밋을 비교하는 법에 대해 더 읽어 보세요.*](https://help.github.com/articles/comparing-commits-across-time) +![Just a screenshot](http://i.imgur.com/J5bMf7S.png) -### Compare branches across forked repositories +### Quick Quoting -포크된 저장소간의 브랜치를 비교하려면 URL을 이렇게 변경하세요. +스레드에 답글들 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다. + +![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) + +[*빠른 인용에 대해 더 읽어 보세요.*](https://github.com/blog/1399-quick-quotes) + +### Quick Licensing + +저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. + +![Licese](http://i.imgur.com/Chqj4Fg.png) + +이미 있는 저장소에도 웹 인터페이스에서 새 파일을 만들어 추가할 수 있습니다. +이름에 `LICENSE`를 입력하면 옵션으로 템플릿을 사용할 수 있습니다. + +![License](http://i.imgur.com/fTjQict.png) + +`.gitignore`에도 똑같이 적용됩니다. + +[*오픈 소스 저작권에 대해 더 읽어 보세요.*](https://help.github.com/articles/open-source-licensing) + +### Task Lists + +이슈와 풀 리퀘스트에서 밑의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.) ``` -https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +- [ ] Be awesome +- [ ] Do stuff +- [ ] Sleep ``` -예를 들면 +![Task List](http://i.imgur.com/k2qZi56.png) + +체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다. ``` -https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master +- [x] Be awesome +- [x] Do stuff +- [ ] Sleep ``` -## Line Highlighting in Repos +[*테스크 리스트에 대해 더 읽어 보세요.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) -코드 파일 URL의 끝에 `#L52`를 추가하거나 줄 번호를 클릭하면 그 줄 번호를 하이라이트합니다. +### Relative Links -`#L53-L60`처럼 범위지정도 가능합니다. 범위를 지정하려면 `shift`키를 누른 채 두 라인을 클릭하면 됩니다. +상대 경로 링크는 마크다운 파일이 내부 건탠츠로 링크될 때 추천합니다. -``` -https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 +```markdown +[Link to a header](#awesome-section) + +[Link to a file](docs/readme) ``` -![Line Highlighting](http://i.imgur.com/8AhjrCz.png) +절대 경로 링크는 URL이 변경 될 때 마다 변경해야 합니다. (예를 들어 저장소 이름 변경, 유저이름 변경, 프로젝트 포크) +상대 경로 링크를 사용하면 문서를 쉽게 스스로 독립적으로 만들 수 있습니다. + +[*상대 경로 링크에 대해 더 읽어 보세요.*](https://help.github.com/articles/relative-links-in-readmes) -## Metadata and Plugin Support for GitHub Pages +### Metadata and Plugin Support for GitHub Pages 지킬로 작성된 페이지와 포스트에서, 저장소 정보는 예를 들어 `{{ site.github.project_title }}`처럼 `site.github` 이름 공간으로 사용하고 표시할 수 있습니다. @@ -322,17 +334,21 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis [*저장소 메타 데이타와 깃허브 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](Repository metadata and plugin support for GitHub Pages) -## Diffs +### Diffs -### Rendered Prose Diffs +#### Rendered Prose Diffs -산문(prose) 파일이 있는 커밋과 풀 리퀘스트는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. "rendered" 버튼을 클릭하시면 렌더된 문서에서 변경을 확인하실 수 있습니다. 렌더된 산문(prose) 뷰는 문장을 추가, 삭제, 변경했을때 유용합니다. +산문(prose) 파일이 있는 커밋과 풀 리퀘스트는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. + +![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) + +"rendered" 버튼을 클릭하시면 렌더된 문서에서 변경을 확인하실 수 있습니다. 렌더된 산문(prose) 뷰는 문장을 추가, 삭제, 변경했을때 유용합니다. ![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) [*렌더된 산문(prose) diff에 대해 더 읽어 보세요.*](https://github.com/blog/1784-rendered-prose-diffs) -### Diffable Maps +#### Diffable Maps 지오데이타가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 깃허브는 무엇이 변경 되었는지 시각적으로 보여줍니다. @@ -340,61 +356,131 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis [*diff 가능한 맵에 대해 더 읽어 보세요.*](https://github.com/blog/1772-diffable-more-customizable-maps) -### Expanding Context in Diffs +#### Expanding Context in Diffs -Using the *unfold* button in the gutter of a diff, you can reveal additional lines of context with a click. You can keep clicking *unfold* until you've revealed the whole file, and the feature is available anywhere GitHub renders diffs. +diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 있습니다. 전채 파일을 표시할때까지 계속 *펼칠* 수 있으며, 깃허브에서 diff가 표시되는 장소라면 어디서든 사용가능합니다. ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) [*diff에서의 문맥 확장에 대해 더 읽어 보세요.*](https://github.com/blog/1705-expanding-context-in-diffs) -## Emojis +### Hub - Git Wrapper -에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등등에서 `:에모지의_이름:`으로 만들 수 있습니다. +[Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. + +이런 명령 대신에 +```bash +$ git clone https://github.com/tiimgreen/toc.git ``` -:smile: -:poop: -:shipit: -:+1: + +이렇게 할 수 있습니다. + +```bash +$ hub clone tiimgreen/toc ``` -:smile: -:poop: -:shipit: -:+1: +[*Hub가 제공하는 더 멋진 기능들을 확인해 보세요.*](https://github.com/github/hub#commands) -깃허브에서 사용 가능한 에모지의 전 목록은 [여기](http://www.emoji-cheat-sheet.com/) 나 [여기](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. +### Decreasing Contributor Friction -깃허브에서 많이 사용하는 에모지 탑 5위는 이렇습니다. +사람들이 사용하고 기여할 수 있는 프로젝트를 만드려면, 가장 기본적인 질문에 대답할 수 있어야합니다. 이 프로젝트는 무엇입니까? 어떻게 사용합니까? 어디까지 허용됩니까? 어떻게 기여합니까? 어떻게 개발하고 실행해야 합니까? 어떻게 새로운 기능이 이전 기능을 손상되지 않았는지 확인해야 합니까? + +[Friction](https://github.com/rafalchmiel/friction)은 이러한 일반적인 [질문들의 답](https://github.com/rafalchmiel/friction/wiki)이 프로젝트 안에 있는지 확인하는 커맨드 라인 스크립트 입니다. 다음은 샘플 출력 입니다. -1. :shipit: `:shipit:` -2. :sparkles: `:sparkles:` -3. :-1: `:-1:` -4. :+1: `:+1:` -5. :clap: `:clap:` +[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) -## Images/GIFs +### Contributing Guidelines -커맨트나 README등등에 이미지와 GIF를 넣을 수 있습니다. +저장소의 제일 위에 `CONTRIBUTING` 파일을 넣어두면 기여자가 이슈를 만들거나 풀 리퀘스트를 만들 때 링크로 보여줍니다. +![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) + +[*기여하기에 대해 더 읽어 보세요.*](https://github.com/blog/1184-contributing-guidelines) + +## Git + +### Previous Branch + +커맨드 라인에서 이전 디렉터리로 이동하려면 이렇게 합니다. + +```bash +$ cd - ``` -![Alt Text](http://image_url.com/image.jpg) + +비슷하게, 깃에서 마지막 브랜치로 돌아가는 건 이렇게 할 수 있습니다. + +```bash +$ git checkout - +# Switched to branch 'master' + +$ git checkout - +# Switched to branch 'next' + +$ git checkout - +# Switched to branch 'master' ``` -![Cat and Rabbit](http://i.imgur.com/PoBmL0W.gif) +[*깃 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) -모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다. +### Checking out Pull Requests -## Quick Quoting +풀 리퀘스트를 체크아웃하려면, 다음 명령어로 가져올 수 있습니다. -스레드에 답글들 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다. +```bash +$ git fetch origin '+refs/pull/*/head:refs/pull/*' +``` -![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) +그리고 다음 명령을 사용해 풀 리퀘스트(예를 들어 42라면)를 체크아웃합니다. -[*빠른 인용에 대해 더 읽어 보세요.*](https://github.com/blog/1399-quick-quotes) +```bash +$ git checkout refs/pull/42 +``` -## Styled Git Status +아니면, 리모트 브랜치에서 가져올 수도 있습니다. + +```bash +$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' +``` + +그리고 체크아웃은 이렇게 합니다. + +```bash +$ git checkout origin/pr/42 +``` + +그리고 밑의 줄을 .git/config에 추가하면, 자동으로 가져오게도 할 수 있습니다. + +``` +[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/* +``` + +[*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally) + +### Empty Commits :trollface: + +`--allow-empty`를 추가하시면 코드의 변경 없이 커밋을 넣을 수 있습니다. + +```bash +$ git commit -m "Big-ass commit" --allow-empty +``` + +있을 법한 사용법에는 이런 것들이 있습니다. + + - 한 뭉치의 일을 시작하기 전에 주석으로 사용 + - 코드와 관련없는 프로젝트 수정을 할때 주석으로 사용 + - 저장소를 사용하는 사람과의 대화 + +### Styled Git Status ```bash $ git status @@ -412,7 +498,7 @@ $ git status -sb [*깃 `status` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-status) -## Styled Git Log +### Styled Git Log ```bash $ git log --all --graph --decorate --oneline --abbrev-commit @@ -424,7 +510,7 @@ NOTE: 이 명령을 알리아스 (단축 명령)으로 넣을 수 있습니다. [*깃 `log` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-log) -## Git Query +### Git Query 깃 쿼리는 모든 이전 커밋 메시지에서 검색해 가장 최근의 쿼리에 맞는 커밋을 찾아줍니다. @@ -442,7 +528,7 @@ $ git show :/typo NOTE: 나오려면 `q`를 누르세요. -## Merged Branches +### Merged Branches ```bash $ git branch --merged @@ -460,63 +546,26 @@ $ git branch --no-merged [*깃 `branch` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-branch) -## Quick Licensing +### Web Server for Browsing Local Repositories -저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. +깃 `instaweb` 커맨드을 사용하면, 즉석에서 `gitweb`안에서 작업중인 저장소를 둘러 볼 +수 있습니다. 이 커맨드는 `gitweb`과 로컬 저장소를 브라우징 하기 위한 웹 서버를 설정하는 스크립트입니다. -![Licese](http://i.imgur.com/Chqj4Fg.png) - -이미 있는 저장소에도 웹 인터페이스에서 새 파일을 만들어 추가할 수 있습니다. -이름에 `LICENSE`를 입력하면 옵션으로 템플릿을 사용할 수 있습니다. - -![License](http://i.imgur.com/fTjQict.png) - -`.gitignore`에도 똑같이 적용됩니다. - -[*오픈 소스 저작권에 대해 더 읽어 보세요.*](https://help.github.com/articles/open-source-licensing) - -## Task Lists - -이슈와 풀 리퀘스트에서 밑의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.) - -``` -- [ ] Be awesome -- [ ] Do stuff -- [ ] Sleep -``` - -![Task List](http://i.imgur.com/k2qZi56.png) - -체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다. - -``` -- [x] Be awesome -- [x] Do stuff -- [ ] Sleep +```bash +$ git instaweb ``` -[*테스크 리스트에 대해 더 읽어 보세요.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) - -## Relative Links - -상대 경로 링크는 마크다운 파일이 내부 건탠츠로 링크될 때 추천합니다. - -```markdown -[Link to a header](#awesome-section) +Opens: -[Link to a file](docs/readme) -``` +![Git instaweb](http://i.imgur.com/Dxekmqc.png) -절대 경로 링크는 URL이 변경 될 때 마다 변경해야 합니다. (예를 들어 저장소 이름 변경, 유저이름 변경, 프로젝트 포크) -상대 경로 링크를 사용하면 문서를 쉽게 스스로 독립적으로 만들 수 있습니다. - -[*상대 경로 링크에 대해 더 읽어 보세요.*](https://help.github.com/articles/relative-links-in-readmes) +[*깃 `instaweb` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-instaweb) -## `.gitconfig` Recommendations +### Git Configurations `.gitconfig`는 모든 설정이 들어있는 파일입니다. -### Aliases +#### Aliases 알리아스는 커스텀 깃 명령어를 등록할 수 있는 핼퍼입니다. 예를 들어 `git a`로 `git add --all`를 실행하게 할 수 있습니다. @@ -563,7 +612,7 @@ $ git config alias.ac 'add -A . && commit' | `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` | | `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | -### Auto-correct +#### Auto-correct 현재 `git comit`를 치면 이런 결과를 보실 수 있습니다. @@ -590,7 +639,7 @@ $ git comit -m "Message" # in 0.1 seconds automatically... ``` -### Color +#### Color 깃 커맨드 라인에 색을 넣으려면 이렇게 하세요. @@ -599,7 +648,3 @@ $ git config --global color.ui 1 ``` [*깃 `config` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-config) - -# Sharing - -[트위터](https://twitter.com/intent/tweet?source=webclient&text=http%3A%2F%2Fgit.io%2FvvT17g%20-%20깃허브%20치트%20시트)에 공유하기 From 2f281dd4c60698285af41143996d5d749a125a1c Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Wed, 16 Apr 2014 11:07:57 +0900 Subject: [PATCH 051/292] Update to 3eb2d45 --- README.ko.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index 0e50b54..081e4a6 100644 --- a/README.ko.md +++ b/README.ko.md @@ -278,7 +278,7 @@ puts table.to_s 저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. -![Licese](http://i.imgur.com/Chqj4Fg.png) +![License](http://i.imgur.com/Chqj4Fg.png) 이미 있는 저장소에도 웹 인터페이스에서 새 파일을 만들어 추가할 수 있습니다. 이름에 `LICENSE`를 입력하면 옵션으로 템플릿을 사용할 수 있습니다. From 527cc25dd1a635302acf6659e9618f62d7e10aea Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:07:02 +0100 Subject: [PATCH 052/292] Add some resources about Git (partly fixes #23) --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 172bbe7..c69633c 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Aliases](#aliases) - [Auto-Correct](#auto-correct) - [Color](#color) + - [Git Resources](#git-resources) + - [Git Books](#git-books) ## GitHub ### Ignore Whitespace @@ -603,3 +605,29 @@ $ git config --global color.ui 1 ``` [*Read more about the Git `config` command.*](http://git-scm.com/docs/git-config) + +### Git Resources +| 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/ | +| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | +| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | +| Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | + +#### 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 Peepcode | http://peepcode.com/products/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 | From ad99cf9c5e4bdf1cd5aa410baad18e53dfa12474 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:10:09 +0100 Subject: [PATCH 053/292] Add some GitHub resources (#23) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index c69633c..32562db 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) + - [GitHub Resources](#github-resources) - [Git](#git) - [Previous Branch](#previous-branch) - [Checking out Pull Requests](#checking-out-pull-requests) @@ -363,6 +364,15 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y [*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) +### GitHub Resources +| 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/ | + ## Git ### Previous Branch To move to the previous branch in Git: From b5a872a88c784c1658f193220ada1e4e8159265e Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:16:29 +0100 Subject: [PATCH 054/292] Add links to talks about GitHub --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 32562db..cb743f6 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) - [GitHub Resources](#github-resources) + - [GitHub Talks](#github-talks) - [Git](#git) - [Previous Branch](#previous-branch) - [Checking out Pull Requests](#checking-out-pull-requests) @@ -373,6 +374,11 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y | 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 | + ## Git ### Previous Branch To move to the previous branch in Git: From 0508be9ea701647b85f9d2df5705215bafdd9e36 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:17:12 +0100 Subject: [PATCH 055/292] Add link to talk about GH --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb743f6..b104d74 100644 --- a/README.md +++ b/README.md @@ -378,6 +378,7 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y | 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 | ## Git ### Previous Branch From 2b84ae8ed0bb98eef67904a9d8b3fbb8764d6b9c Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:18:57 +0100 Subject: [PATCH 056/292] Add one more talk --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b104d74..1586d74 100644 --- a/README.md +++ b/README.md @@ -379,6 +379,7 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y | ----- | ---- | | 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 ### Previous Branch From 350635573cc96c0e7c2a0bb5b506593eeb4e0785 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:20:13 +0100 Subject: [PATCH 057/292] Add talks by @holman --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1586d74..a532e49 100644 --- a/README.md +++ b/README.md @@ -380,6 +380,8 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y | 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 ### Previous Branch From cb6d09422ab9cbaa1227fc8e59a8d82a4b31b83f Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:26:40 +0100 Subject: [PATCH 058/292] Add Gists screenshot --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a532e49..770ef54 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,11 @@ https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master ``` ### Gists -[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. +[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repository. + +![Gist](http://i.imgur.com/VkKI1LC.png?1) + +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. Gists can be treated as a full repository so they can be cloned like any other: From 97a5328a1bf101c704596f943db85a3d01624ded Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:28:43 +0100 Subject: [PATCH 059/292] Add Git.io screenshot example --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 770ef54..e0afcae 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,11 @@ $ git clone https://gist.github.com/tiimgreen/10545817 [*Read more about creating gists.*](https://help.github.com/articles/creating-gists) ### Git.io -[Git.io](http://git.io) is a simple URL shortener for GitHub. You can also use it via pure HTTP using Curl: +[Git.io](http://git.io) is a simple URL shortener for GitHub. + +![Git.io](http://i.imgur.com/6JUfbcG.png?1) + +You can also use it via pure HTTP using Curl: ```bash $ curl -i http://git.io -F "url=https://github.com/..." From ef29a1322e42cff2f40846dbd9df95b5467abc63 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:30:10 +0100 Subject: [PATCH 060/292] Add keyboard screenshot example --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e0afcae..d0579ce 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,9 @@ When on a repository page, keyboard shortcuts allow you to navigate easily. - Pressing `l` will edit labels on existing Issues. - 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. -To see all of the shortcuts for the current page press `?`. +To see all of the shortcuts for the current page press `?`: + +![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) [*Read more about using the Command Bar.*](https://help.github.com/articles/using-the-command-bar) From ac15804c9a0b7ce3c8e422bbab9ad969fe5cb82d Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:33:51 +0100 Subject: [PATCH 061/292] Add compare branch example --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d0579ce..85a23ed 100644 --- a/README.md +++ b/README.md @@ -82,10 +82,13 @@ https://github.com/user/repo/compare/{range} Where `{range} = master...4-1-stable` For example: + ``` https://github.com/rails/rails/compare/master...4-1-stable ``` +![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) + `{range}` can be changed to things like: ``` From 3d24fe74dee2e48ba85d66228d36739a82d24a89 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:36:45 +0100 Subject: [PATCH 062/292] Add commit history example --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 85a23ed..cb0f6fa 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ To view all commits on a repo by author add `?author=username` to the URL. https://github.com/rails/rails/commits/master?author=dhh ``` +![DHH commit history](http://i.imgur.com/mDWwuaY.png) + [*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) ### Cloning a Repository From 957019cfed90d9d1ca5bda940bf2e4c176ca399f Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:38:41 +0100 Subject: [PATCH 063/292] Add example forked repo compare --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb0f6fa..6c91950 100644 --- a/README.md +++ b/README.md @@ -112,9 +112,11 @@ https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} For example: ``` -https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master +https://github.com/rails/rails/compare/byroot:master...master ``` +![Forked branch compare](http://i.imgur.com/Q1W6qcB.png) + ### Gists [Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repository. From 9274e6222e1a7030144fe04989c02d15a3452000 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:42:49 +0100 Subject: [PATCH 064/292] Add another branch compare example --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6c91950..84cfc42 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,8 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` +![Another compare example](http://i.imgur.com/5dtzESz.png) + ...which allows you to see the difference on the master branch up a set time ago or a specified date. [*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) From 3ce96f8e1ca8d7f5b739ca904b74d934e1a5e5ad Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:49:25 +0100 Subject: [PATCH 065/292] Improve recently merged section --- README.md | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1e3f466..0b7a18f 100644 --- a/README.md +++ b/README.md @@ -355,16 +355,35 @@ Using the *unfold* button in the gutter of a diff, you can reveal additional lin [*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs) #### Getting content of Pull Request in Diff or Patch format +You can get the diff of a Pull Request by adding a `.diff` or `.patch` +extension to the end of the URL. For example: -You can get the diff of viewed pull request by adding `.diff` or `.patch` -to the end of URL. For example: +``` +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 +``` -* -* - the pull - request in DIFF format -* - the pull - request as PATCH +The `.diff` extension would give you this in plain text: +``` +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 + +(...) +``` ### Hub [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. From 404f919b70e9f44da0e30c9b215e86908ea9bd40 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 10:50:16 +0100 Subject: [PATCH 066/292] Change title of one section --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b7a18f..93bcbd1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Rendered prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) - [Expanding Context in Diffs](#expanding-context-in-diffs) - - [Getting content of Pull Request in Diff or Patch format](#getting-content-of-pull-request-in-diff-or-patch-format) + - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) @@ -354,7 +354,7 @@ Using the *unfold* button in the gutter of a diff, you can reveal additional lin [*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs) -#### Getting content of Pull Request in Diff or Patch format +#### Diff or Patch of Pull Request You can get the diff of a Pull Request by adding a `.diff` or `.patch` extension to the end of the URL. For example: From cb5058e2b60b537861670c96ec4eaef247f957c4 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 12:15:08 +0100 Subject: [PATCH 067/292] Add 'CI Status on Pull Requests' section (fixes #22) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 93bcbd1..91b3c4e 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Line Highlighting in Repositories](#line-highlighting-in-repositories) - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) - [Cross-Link Issues](#cross-link-issues) + - [CI Status on Pull Requests](#ci-status-on-pull-requests) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) @@ -202,6 +203,13 @@ To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e. ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) +### CI Status on Pull Requests +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/). + +[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) + +[*Read more about the commit status API.*](https://github.com/blog/1227-commit-status-api) + ### Syntax Highlighting in Markdown Files For example, to syntax highlight Ruby code in your Markdown files write: From fea81dbbe5d87f210e3b455ad8c0c33fb6faaed0 Mon Sep 17 00:00:00 2001 From: Hariadi Hinta Date: Wed, 16 Apr 2014 21:28:24 +0800 Subject: [PATCH 068/292] URL: Metadata and Plugin Support for GitHub Pages --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 91b3c4e..94add82 100644 --- a/README.md +++ b/README.md @@ -334,7 +334,7 @@ Within Jekyll pages and posts, repository information is available within the `s 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. -[*Read more about repository metadata and plugin support for GitHub Pages.*](Repository metadata and plugin support for GitHub Pages) +[*Read more about repository metadata and plugin support for GitHub Pages.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) ### Diffs #### Rendered Prose Diffs From 7e669d32ed39d754e8978cc3eb43cca43520e21f Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 16 Apr 2014 17:08:41 +0100 Subject: [PATCH 069/292] Add Ignoring Whitespace example --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 94add82..a98bc6f 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c ### Ignore Whitespace Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed. +![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) + [*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) ### Commit History by Author From 803319ce284a0dd1497eb4a523b4186b935c04e9 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 16 Apr 2014 17:17:57 +0100 Subject: [PATCH 070/292] Add date format helper for comparing branches --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a98bc6f..420cf20 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,8 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` +*Dates are in the format `YYYY-DD-MM`* + ![Another compare example](http://i.imgur.com/5dtzESz.png) ...which allows you to see the difference on the master branch up a set time ago or a specified date. From c2cbbc3d909629d3058f14be6c4adc8bcf01cbc2 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 16 Apr 2014 17:24:20 +0100 Subject: [PATCH 071/292] Literally link emoji lists to add clarity --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 420cf20..9e31449 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ Would produce: :smile: -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). +The full list of supported Emojis on GitHub can be found at [http://www.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). The top 5 used Ejmojis on GitHub are: From bdb3f77d37d2cd27e9825b59bd4537f45eaf0295 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 16 Apr 2014 17:25:49 +0100 Subject: [PATCH 072/292] Format link better --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e31449..ae044b7 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ Would produce: :smile: -The full list of supported Emojis on GitHub can be found at [http://www.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). +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). The top 5 used Ejmojis on GitHub are: From 8e5b0bdd4535680d16f47bccd2f3c70d7d646aba Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 16 Apr 2014 17:30:08 +0100 Subject: [PATCH 073/292] Remove verbose Hub example --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index ae044b7..b5d4502 100644 --- a/README.md +++ b/README.md @@ -406,12 +406,6 @@ This allows you to do things like: $ hub clone tiimgreen/toc ``` -...instead of: - -```bash -$ git clone https://github.com/tiimgreen/toc.git -``` - [*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) ### Decreasing Contributor Friction From 6ca33bdb0200369fadfed23c59963c862af53ca0 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 16 Apr 2014 18:09:35 +0100 Subject: [PATCH 074/292] Stripspace --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index b5d4502..dcfb589 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub Talks](#github-talks) - [Git](#git) - [Previous Branch](#previous-branch) + - [Stripspace](#stripspace) - [Checking out Pull Requests](#checking-out-pull-requests) - [Empty Commits :trollface:](#empty-commits-trollface) - [Styled Git Status](#styled-git-status) @@ -457,6 +458,21 @@ $ git checkout - [*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) +### Stripspace + +Git Stripspace: + +- Strips trailing whitespace +- Collapses newlines +- Adds newline to end of file + +A file must be passed when calling the command, e.g.: +```bash +$ git stripspace < README.md +``` + +[*Read more about the Git `stripspace` command.*](https://www.kernel.org/pub/software/scm/git/docs/git-stripspace.html) + ### Checking out Pull Requests If you want to check out pull request locally, you can fetch it using that command: From d3b05869c498d8dbab31a909042fe5bf3711a5c8 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 16 Apr 2014 18:40:00 +0100 Subject: [PATCH 075/292] Use different link to Git docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dcfb589..f039c6b 100644 --- a/README.md +++ b/README.md @@ -471,7 +471,7 @@ A file must be passed when calling the command, e.g.: $ git stripspace < README.md ``` -[*Read more about the Git `stripspace` command.*](https://www.kernel.org/pub/software/scm/git/docs/git-stripspace.html) +[*Read more about the Git `stripspace` command.*](http://git-scm.com/docs/git-stripspace) ### Checking out Pull Requests If you want to check out pull request locally, you can fetch it using that command: From a40233516be5453afa29d6775d492cc80a0d4203 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Thu, 17 Apr 2014 08:40:05 +0900 Subject: [PATCH 076/292] Update to d3b0586 --- README.ko.md | 148 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 138 insertions(+), 10 deletions(-) diff --git a/README.ko.md b/README.ko.md index 081e4a6..8d54852 100644 --- a/README.ko.md +++ b/README.ko.md @@ -16,6 +16,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Line Highlighting in Repositories](#line-highlighting-in-repositories) - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) - [Cross-Link Issues](#cross-link-issues) + - [CI Status on Pull Requests](#ci-status-on-pull-requests) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) @@ -29,11 +30,15 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Rendered prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) - [Expanding Context in Diffs](#expanding-context-in-diffs) + - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) + - [GitHub Resources](#github-resources) + - [GitHub Talks](#github-talks) - [Git](#git) - [Previous Branch](#previous-branch) + - [Stripspace](#stripspace) - [Checking out Pull Requests](#checking-out-pull-requests) - [Empty Commits :trollface:](#empty-commits-trollface) - [Styled Git Status](#styled-git-status) @@ -45,6 +50,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Aliases](#aliases) - [Auto-Correct](#auto-correct) - [Color](#color) + - [Git Resources](#git-resources) + - [Git Books](#git-books) ## GitHub @@ -52,6 +59,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c `?w=1`를 diff URL에 추가하면 변경된 코드만 볼 수 있도록, 공백만 바뀐 수정을 제거할 수 있습니다. +![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) + [*깃허브의 비밀을 더 읽어 보세요.*](https://github.com/blog/967-github-secrets) ### Commit History by Author @@ -62,6 +71,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c https://github.com/rails/rails/commits/master?author=dhh ``` +![DHH commit history](http://i.imgur.com/mDWwuaY.png) + [*커밋 뷰간의 차이에 대해 더 읽어보세요.*](https://help.github.com/articles/differences-between-commit-views) ### Cloning a Repository @@ -84,11 +95,14 @@ https://github.com/user/repo/compare/{range} `{range}`는 `master...4-1-stable`식으로 적습니다. -예를 들어: +예를 들어 + ``` https://github.com/rails/rails/compare/master...4-1-stable ``` +![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) + `{range}` 는 이렇게 적을 수도 있습니다. ``` @@ -96,6 +110,10 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` +*날짜는 `YYYY-DD-MM`형식으로 적습니다* + +![Another compare example](http://i.imgur.com/5dtzESz.png) + 이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다. [*시간으로 커밋을 비교하는 법에 대해 더 읽어 보세요.*](https://help.github.com/articles/comparing-commits-across-time) @@ -114,9 +132,15 @@ https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master ``` +![Forked branch compare](http://i.imgur.com/Q1W6qcB.png) + ### Gists -[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. [이렇게](https://gist.github.com/tiimgreen/10545817.pibb) Gist URL뒤에 `.pibb`를 넣으면 다른 사이트에 넣을수 있는 *HTML 온리* 버전을 넣을 수 있습니다. +[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. + +![Gist](http://i.imgur.com/VkKI1LC.png?1) + +[이렇게](https://gist.github.com/tiimgreen/10545817.pibb) Gist URL뒤에 `.pibb`를 넣으면 다른 사이트에 넣을수 있는 *HTML 온리* 버전을 만들 수 있습니다. Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다. @@ -130,7 +154,11 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ### Git.io -[Git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. 순수 HTTP에서 Curl으로 사용하실 수도 있습니다. +[Git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. + +![Git.io](http://i.imgur.com/6JUfbcG.png?1) + +순수 HTTP에서 Curl으로 사용하실 수도 있습니다. ```bash $ curl -i http://git.io -F "url=https://github.com/..." @@ -156,6 +184,8 @@ Location: https://github.com/... 지금 페이지에서 쓸 수 있는 모든 단축키를 보시려면 `?`를 누르세요. +![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) + [*커맨드 바의 사용법을 더 읽어 보세요.*](https://help.github.com/articles/using-the-command-bar) ### Line Highlighting in Repos @@ -192,6 +222,14 @@ $ git commit -m "Fix cock up, fixes #12" ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) +### CI Status on Pull Requests + +정확히 설정되었다면, 풀 리퀘스트를 받거나 풀 리퀘스트에 새로운 커밋을 할 때 마다, [Travis CI](https://travis-ci.org/)가 풀 리퀘스트를 빌드 할 것입니다. [Travis CI 시작하기](http://docs.travis-ci.com/user/getting-started/)를 좀 더 읽어보세요. + +[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) + +[*커밋 상태 API에 대해 좀 더 읽어보세요.*](https://github.com/blog/1227-commit-status-api) + ### Syntax Highlighting in Markdown Files 마크다운에서 예를 들어, 루비 코드를 신텍스 하이라이트 하려면 이렇게 합니다. @@ -232,7 +270,7 @@ puts table.to_s :shipit: :+1: -깃허브에서 사용 가능한 에모지의 전 목록은 [여기](http://www.emoji-cheat-sheet.com/) 나 [여기](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. +깃허브에서 사용 가능한 에모지의 전 목록은 [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 나 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. 깃허브에서 많이 사용하는 에모지 탑 5위는 이렇습니다. @@ -332,7 +370,7 @@ puts table.to_s Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis)와 [@mentions](https://github.com/blog/821)을 지킬 포스트와 페이지에서 사용하게 합니다. -[*저장소 메타 데이타와 깃허브 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](Repository metadata and plugin support for GitHub Pages) +[*저장소 메타 데이타와 깃허브 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) ### Diffs @@ -364,15 +402,41 @@ diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 [*diff에서의 문맥 확장에 대해 더 읽어 보세요.*](https://github.com/blog/1705-expanding-context-in-diffs) -### Hub - Git Wrapper +#### Diff or Patch of Pull Request -[Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. +URL뒤에 `.diff` 나 `.patch`를 붙이면 풀 리퀘스트의 diff를 얻을 수 있습니다. +예를 들면 + +``` +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` 확장자는 이런 내용의 평범한(plain) 텍스트를 줍니다. -```bash -$ git clone https://github.com/tiimgreen/toc.git ``` +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 + +(...) +``` + +### Hub - Git Wrapper + +[Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. 이렇게 할 수 있습니다. @@ -398,6 +462,26 @@ $ hub clone tiimgreen/toc [*기여하기에 대해 더 읽어 보세요.*](https://github.com/blog/1184-contributing-guidelines) +### GitHub Resources + +| 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 ### Previous Branch @@ -423,6 +507,22 @@ $ git checkout - [*깃 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) +### Stripspace + +깃 Stripspace는 이런 일을 합니다. + +- 줄 끝의 공백을 제거 +- 빈줄을 줄임 +- 파일 끝에 빈 줄을 추가 + +커맨드를 실행 할 때 파일을 반드시 이런식으로 넘겨줘야 합니다. + +```bash +$ git stripspace < README.md +``` + +[*깃 `stripspace` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-stripspace) + ### Checking out Pull Requests 풀 리퀘스트를 체크아웃하려면, 다음 명령어로 가져올 수 있습니다. @@ -648,3 +748,31 @@ $ git config --global color.ui 1 ``` [*깃 `config` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-config) + +### Git Resources + +| 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/ | +| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | +| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | +| Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | + +#### 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 Peepcode | http://peepcode.com/products/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 | From 2a9c1fc0ce7fa17c9f42008b4ff93fd45b891d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20=E2=80=9CKwpolska=E2=80=9D=20Warrick?= Date: Thu, 17 Apr 2014 13:29:31 +0200 Subject: [PATCH 077/292] Issues can also be closed by resolve(|s|d) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As documented in https://help.github.com/articles/closing-issues-via-commit-messages (to which the section links on the end!). resolve* was not there from the very beginning, though — and thus many people (get off my lawn!) don’t know about it. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f039c6b..a8f2e00 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Line Highlighting](http://i.imgur.com/8AhjrCz.png) ### Closing Issues via Commit Messages -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 once it is committed to the master branch. +If a particular commit fixes an issue, any of the keywords `fix/fixes/fixed`, `close/closes/closed` or `resolve/resolves/resolved`, followed by the issue number, will close the issue once it is committed to the master branch. ```bash $ git commit -m "Fix cock up, fixes #12" From 8642db715362bf1a13b1f8464d34b829cc1eccfe Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Thu, 17 Apr 2014 16:11:29 +0100 Subject: [PATCH 078/292] Note which MRI versions Friction supports (due to rafalchmiel/friction#11) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a8f2e00..65f8d5f 100644 --- a/README.md +++ b/README.md @@ -416,6 +416,8 @@ If you want people to use and contribute to your project, you need to start by a [![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) +*Friction supports MRI 2.1.0, MRI 2.0.0, and MRI 1.9.3.* + ### Contributing Guidelines Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. From 43ea5847c181d0ceae194ee19da4b017cfdc1f6e Mon Sep 17 00:00:00 2001 From: RasPat1 Date: Thu, 17 Apr 2014 14:57:44 -0400 Subject: [PATCH 079/292] A more elaborate git log Beautiful git log that looks just like gitk. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65f8d5f..20f67b8 100644 --- a/README.md +++ b/README.md @@ -558,12 +558,14 @@ This is produced: Running: ```bash -$ git log --all --graph --decorate --oneline --abbrev-commit +$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\n--abbrev-commit --date=relative ``` Produces: -![git log --all --graph --decorate --oneline --abbrev-commit](http://i.imgur.com/RUPycwI.png) +![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\n--abbrev-commit --date=relative](http://imgur.com/ZcMZiD3) + +Add this as an alias to your global git config. Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) *This can be aliased using the instructions found [here](https://github.com/tiimgreen/github-cheat-sheet#aliases).* From 3c20d96ec7b0040b2be1a5229db495fefc56957d Mon Sep 17 00:00:00 2001 From: RasPat1 Date: Thu, 17 Apr 2014 17:01:40 -0400 Subject: [PATCH 080/292] Remove \n Update image Random \n and image replaced with consistent terminal output --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20f67b8..31dc98e 100644 --- a/README.md +++ b/README.md @@ -563,7 +563,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s Produces: -![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\n--abbrev-commit --date=relative](http://imgur.com/ZcMZiD3) +![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) Add this as an alias to your global git config. Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) From 69da2b5c44de7ea27a15edbd4137536d3f3d4a0b Mon Sep 17 00:00:00 2001 From: Tim Green Date: Thu, 17 Apr 2014 22:10:59 +0100 Subject: [PATCH 081/292] Remove newline literal and duplicated info --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 31dc98e..5b9eb10 100644 --- a/README.md +++ b/README.md @@ -558,14 +558,14 @@ This is produced: Running: ```bash -$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\n--abbrev-commit --date=relative +$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative ``` Produces: ![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) -Add this as an alias to your global git config. Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) +Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) *This can be aliased using the instructions found [here](https://github.com/tiimgreen/github-cheat-sheet#aliases).* From cbe8a0474d9766d16685762df6913e9e89238852 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Fri, 18 Apr 2014 09:09:24 +0900 Subject: [PATCH 082/292] Update to 69da2b5 --- README.ko.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.ko.md b/README.ko.md index 8d54852..7ac487f 100644 --- a/README.ko.md +++ b/README.ko.md @@ -202,7 +202,7 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ### Closing Issues with Commits -어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`나 `close/closes/closed`를 키워드로 해당 이슈가 마스터 브랜치에 커밋 될 때 닫을 수 있습니다. +어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`, `close/closes/closed`, `resolve/resolves/resolved`를 키워드로 해당 이슈가 마스터 브랜치에 커밋 될 때 닫을 수 있습니다. ```bash $ git commit -m "Fix cock up, fixes #12" @@ -454,6 +454,8 @@ $ hub clone tiimgreen/toc [![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) +*Friction 은 MRI 2.1.0, MRI 2.0.0, MRI 1.9.3을 지원합니다.* + ### Contributing Guidelines 저장소의 제일 위에 `CONTRIBUTING` 파일을 넣어두면 기여자가 이슈를 만들거나 풀 리퀘스트를 만들 때 링크로 보여줍니다. @@ -601,10 +603,12 @@ $ git status -sb ### Styled Git Log ```bash -$ git log --all --graph --decorate --oneline --abbrev-commit +$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative ``` -![git log --all --graph --decorate --oneline --abbrev-commit](http://i.imgur.com/RUPycwI.png) +![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) + +[Palesz](http://stackoverflow.com/users/88355/palesz)님 고맙습니다. NOTE: 이 명령을 알리아스 (단축 명령)으로 넣을 수 있습니다. [여기](#aliases)의 소개를 보세요. From a61bae738dde0e86a637b01c51de6c4ad7e9e298 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Fri, 18 Apr 2014 13:55:49 +0100 Subject: [PATCH 083/292] Add 'Rendering Tabular Data' section (partly fixes #30) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5b9eb10..98a9297 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Task Lists](#task-lists) - [Relative Links](#relative-links) - [Metadata and Plugin Support for GitHub Pages](#metadata-and-plugin-support-for-github-pages) + - [Rendering Tabular Data](#rendering-tabular-data) - [Diffs](#diffs) - [Rendered prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) @@ -341,6 +342,13 @@ The Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](h [*Read more about repository metadata and plugin support for GitHub Pages.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) +### Rendering Tabular Data +GitHub supports rendering tabular data in the form of `.csv` (comma-separated) and `.tsv` (tab-separated) files. + +![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) + +[*Read more about rendering tabular data.*](https://github.com/blog/1601-see-your-csvs) + ### Diffs #### Rendered Prose Diffs Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views. From 93051b944b1c9c39573e5e551f7a92d4dd21c61b Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Fri, 18 Apr 2014 13:59:06 +0100 Subject: [PATCH 084/292] Add section about YAML metadata (fixes #30) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 98a9297..440dc5b 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Task Lists](#task-lists) - [Relative Links](#relative-links) - [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) - [Diffs](#diffs) - [Rendered prose Diffs](#rendered-prose-diffs) @@ -342,6 +343,13 @@ The Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](h [*Read more about repository metadata and plugin support for GitHub Pages.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) +### Viewing YAML Metadata in your Documents +Many blogging websites, like [Jekyll](http://jekyllrb.com/) with [GitHub Pages](http://pages.github.com/), depend on some YAML-formatted metadata at the beginning of your post. GitHub will render this metadata as a horizontal table, for easier reading + +![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) + +[*Read more about viewing YAML metadata in your documents.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) + ### Rendering Tabular Data GitHub supports rendering tabular data in the form of `.csv` (comma-separated) and `.tsv` (tab-separated) files. From f1825ebfde5e122962c73c1f8c006f6e70d29a0d Mon Sep 17 00:00:00 2001 From: Tim Green Date: Fri, 18 Apr 2014 17:30:47 +0100 Subject: [PATCH 085/292] Add --global' to alias helpers --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 440dc5b..4a54196 100644 --- a/README.md +++ b/README.md @@ -657,19 +657,19 @@ To add an alias, either navigate to `~/.gitconfig` and fill it out in the follow ...or type in the command-line: ```bash -$ git config alias.new_alias git_function +$ git config --global alias.new_alias git_function ``` For example: ```bash -$ git config alias.cm commit +$ git config --global alias.cm commit ``` For an alias with multiple functions use quotes: ```bash -$ git config alias.ac 'add -A . && commit' +$ git config --global alias.ac 'add -A . && commit' ``` Some useful aliases include: From 97cbdc0d447456abb97fd6d6b845b08ce9272d88 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Sat, 19 Apr 2014 11:14:26 +0900 Subject: [PATCH 086/292] Update to f1825eb --- README.ko.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/README.ko.md b/README.ko.md index 7ac487f..1e92116 100644 --- a/README.ko.md +++ b/README.ko.md @@ -26,6 +26,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Task Lists](#task-lists) - [Relative Links](#relative-links) - [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) - [Diffs](#diffs) - [Rendered prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) @@ -372,6 +374,22 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis [*저장소 메타 데이타와 깃허브 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) +### Viewing YAML Metadata in your Documents + +[Jekyll](http://jekyllrb.com/)이나 [GitHub Pages](http://pages.github.com/)같은 많은 블로그에서 포스트의 처음에 YAML 포멧의 메타데이터를 필요로 합니다. 깃허브는 이 메타 정보를 읽기 편하게 테이블로 표시해 줍니다. + +![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) + +[*문서에서 YAML 메타데이터 보기에 대해 더 읽어 보세요.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) + +### Rendering Tabular Data + +깃허브는 `.csv` (comma-separated) 와 `.tsv` (tab-separated)파일에 대해 표(tabular) 데이터 보기를 지원합니다. + +![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) + +[*표 데이타 표시에 대해 더 읽어 보세요.*](https://github.com/blog/1601-see-your-csvs) + ### Diffs #### Rendered Prose Diffs @@ -689,19 +707,19 @@ Opens: 커맨드 라인에서 다음 명령을 입력합니다. ```bash -$ git config alias.new_alias git_function +$ git config --global alias.new_alias git_function ``` 예를들면 ```bash -$ git config alias.cm commit +$ git config --global alias.cm commit ``` NOTE: 여러 함수를 알리아스하려면 따옴표를 이용하세요. ```bash -$ git config alias.ac 'add -A . && commit' +$ git config --global alias.ac 'add -A . && commit' ``` 여기 몇 가지 권장 알리아스가 있습니다. From d6047a2c147600a7a530d6af80ea111d581e2aab Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 18 Apr 2014 23:58:59 -0400 Subject: [PATCH 087/292] Add Tab Space URL hack --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4a54196..180f3c5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c ## Table of Contents - [GitHub](#github) - [Ignore Whitespace](#ignore-whitespace) + - [Adjust Tab Space](#adjust-tab-space) - [Commit History by Author](#commit-history-by-author) - [Cloning a Repository](#cloning-a-repository) - [Comparing Branches](#comparing-branches) @@ -61,6 +62,9 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli [*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) +### Adjust Tab Space +Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views. + ### Commit History by Author To view all commits on a repo by author add `?author=username` to the URL. From 5c5278bdd743134e4782e82a13608795d69ae2b0 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Sat, 19 Apr 2014 10:39:04 +0100 Subject: [PATCH 088/292] Add example for tab space trick --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 180f3c5..2d54191 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,14 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli ### Adjust Tab Space Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views. +Here is a Go source file beofre adding `?ts=4`: + +![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) + +...and this is after adding `?ts=4`: + +![After, tab space example](http://i.imgur.com/70FL4H9.png) + ### Commit History by Author To view all commits on a repo by author add `?author=username` to the URL. From 89d89bc1fb275f01be5774c4bd6854fb30266385 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Sat, 19 Apr 2014 10:40:28 +0100 Subject: [PATCH 089/292] Fix typo + add link to source file --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d54191..0190c86 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,11 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli ### Adjust Tab Space Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views. -Here is a Go source file beofre adding `?ts=4`: +Here is a Go source file [before](https://github.com/pengwynn/flint/blob/master/flint/flint.go) adding `?ts=4`: ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) -...and this is after adding `?ts=4`: +...and this is [after](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4) adding `?ts=4`: ![After, tab space example](http://i.imgur.com/70FL4H9.png) From f2df58a4a79f08ade1540ee4968007022ca6aa8d Mon Sep 17 00:00:00 2001 From: Edward Look Date: Sat, 19 Apr 2014 11:55:05 -0700 Subject: [PATCH 090/292] Query is case-sensitive --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0190c86..5debf97 100644 --- a/README.md +++ b/README.md @@ -606,7 +606,7 @@ A Git query allows you to search all your previous commit messages and find the $ git show :/query ``` -Where `query` is the term you want to search, this then finds the last one and gives details on the lines that were changed. +Where `query` (case-sensitive) is the term you want to search, this then finds the last one and gives details on the lines that were changed. ```bash $ git show :/typo From 7632c284f7048f63bce91707c5ba0880a85e4083 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Sun, 20 Apr 2014 16:26:10 +0900 Subject: [PATCH 091/292] Update to 8753d95 --- README.ko.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index 1e92116..c35e549 100644 --- a/README.ko.md +++ b/README.ko.md @@ -6,6 +6,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub](#github) - [Ignore Whitespace](#ignore-whitespace) + - [Adjust Tab Space](#adjust-tab-space) - [Commit History by Author](#commit-history-by-author) - [Cloning a Repository](#cloning-a-repository) - [Comparing Branches](#comparing-branches) @@ -65,6 +66,18 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c [*깃허브의 비밀을 더 읽어 보세요.*](https://github.com/blog/967-github-secrets) +### Adjust Tab Space + +diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값인 8대신 4공백으로 보여줍니다. `ts`뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw파일에는 적용 되지 않습니다. + +여기에 있는 Go 소스 파일은 `?ts=4`를 붙이기 [전에는](https://github.com/pengwynn/flint/blob/master/flint/flint.go) 이렇습니다. + +![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) + +그리고 `?ts=4`를 붙인 [다음에는](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4) 이렇게 됩니다. + +![After, tab space example](http://i.imgur.com/70FL4H9.png) + ### Commit History by Author 특정 커미터가 한 모든 커밋을 보고 싶다면 URL에 `?author=username`를 추가하세요. @@ -640,7 +653,7 @@ NOTE: 이 명령을 알리아스 (단축 명령)으로 넣을 수 있습니다. $ git show :/query ``` -`query`에는 검색하고 싶은 말을 넣으세요. 주어진 검색어가 있는 가장 마지막 커밋을 표시하고 변경된 라인을 보여줍니다. +`query`에는 검색하고 싶은 말을 (대소문자를 구분해) 넣으세요. 주어진 검색어가 있는 가장 마지막 커밋을 표시하고 변경된 라인을 보여줍니다. ```bash $ git show :/typo From 51cb7100c56ce4b2578a69ca230251b330b88cc2 Mon Sep 17 00:00:00 2001 From: Beau Smith Date: Tue, 22 Apr 2014 10:42:39 -0700 Subject: [PATCH 092/292] Adding example to Empty Commits --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5debf97..83f3e3b 100644 --- a/README.md +++ b/README.md @@ -558,6 +558,7 @@ Some use-cases for this (that make sense), include: - Annotating the start of a new bulk of work or a new feature. - Documenting when you make changes to the project that aren't code related. - Communicating with people using your repository. + - As the first commit of a repo as the first commit cannot be rebased later. `git commit -m "init repo" --allow-empty` ### Styled Git Status Running: From 6ad8a1069fec5f8383096e6ccccb246d79feefe6 Mon Sep 17 00:00:00 2001 From: Eric Mill Date: Tue, 22 Apr 2014 15:55:35 -0400 Subject: [PATCH 093/292] less jarring example text --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5debf97..2d76e72 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L If a particular commit fixes an issue, any of the keywords `fix/fixes/fixed`, `close/closes/closed` or `resolve/resolves/resolved`, followed by the issue number, will close the issue once it is committed to the master branch. ```bash -$ git commit -m "Fix cock up, fixes #12" +$ git commit -m "Fix screwup, fixes #12" ``` This closes the issue and references the closing commit. From b678ba93755a1cd085e90fe4f5df98b3a48196a1 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Tue, 22 Apr 2014 21:04:46 +0100 Subject: [PATCH 094/292] Change commit message to please the Americans :+1:, as mentioned in #36 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d76e72..272d533 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ $ git commit -m "Fix screwup, fixes #12" This closes the issue and references the closing commit. -![Closing Repo](http://i.imgur.com/URXFprQ.png) +![Closing Repo](http://i.imgur.com/Uh1gZdx.png) [*Read more about closing Issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) From 50639459accfc3fa1ace49a576dc36c353025a89 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 23 Apr 2014 13:51:16 +0100 Subject: [PATCH 095/292] Add link to Korean translation --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 272d533..4ad55bd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # GitHub Cheat Sheet A collection of cool hidden and not so 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)). +*Read this in [Korean](README.ko.md).* + ## Table of Contents - [GitHub](#github) - [Ignore Whitespace](#ignore-whitespace) From 84436d7aa33c31093ef47c0b6cbd2e334da3b2cf Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 23 Apr 2014 14:00:47 +0100 Subject: [PATCH 096/292] Fix grammar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7a0289..f7cd043 100644 --- a/README.md +++ b/README.md @@ -560,7 +560,7 @@ Some use-cases for this (that make sense), include: - Annotating the start of a new bulk of work or a new feature. - Documenting when you make changes to the project that aren't code related. - Communicating with people using your repository. - - As the first commit of a repo as the first commit cannot be rebased later. `git commit -m "init repo" --allow-empty` + - The first commit of a repo, as the first commit cannot be rebased later: `git commit -m "init repo" --allow-empty`. ### Styled Git Status Running: From 3a95b5ea3cb382ddb3d0f8ac836dcf4ad3af9f76 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Sun, 13 Apr 2014 21:30:13 +0900 Subject: [PATCH 097/292] Add Japanese translation --- README.ja.md | 765 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 765 insertions(+) create mode 100644 README.ja.md diff --git a/README.ja.md b/README.ja.md new file mode 100644 index 0000000..2565eed --- /dev/null +++ b/README.ja.md @@ -0,0 +1,765 @@ +# GitHubカンニング・ペーパー +これは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))の二つのトークを元にしている。 + +# 目次 +- [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%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) + - [コミットからイシューを閉じる](#%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E3%81%8B%E3%82%89%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%82%92%E9%96%89%E3%81%98%E3%82%8B) + - [イシューの相互リンク](#%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%81%AE%E7%9B%B8%E4%BA%92%E3%83%AA%E3%83%B3%E3%82%AF) + - [プルリクエストでのCI結果の表示](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%A7%E3%81%AEci%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA) + - [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) + - [設定済みライセンスの追加](#%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) + - [相対リンク](#%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) + - [差分の表示](#%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) + - [マップ差分の可視化](#%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) + - [プルリクエストの内容をDIFFまたはPATCH形式で取得](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) + - [Hub](#hub) + - [共同開発者との摩擦の軽減](#%E5%85%B1%E5%90%8C%E9%96%8B%E7%99%BA%E8%80%85%E3%81%A8%E3%81%AE%E6%91%A9%E6%93%A6%E3%81%AE%E8%BB%BD%E6%B8%9B) + - [開発参加のガイドライン](#%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) + - [GitHub情報](#github%E6%83%85%E5%A0%B1) + - [GitHub Talks](#github-talks) +- [Git](#git) + - [直前のブランチ](#%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) + - [プルリクエストのチェックアウト](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%A2%E3%82%A6%E3%83%88) + - [空のコミット :trollface:](#%E7%A9%BA%E3%81%AE%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88-trollface) + - [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) + - [マージ済みブランチ](#%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) + - [ローカル・リポジトリを参照するウェブサーバー](#%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`を加えると、空白の変化によるできた差分は表示されなくなり、コード上の変化だけを参照することができる。 + +![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) + +[*GitHubの秘密についてもっと詳しく*](https://github.com/blog/967-github-secrets) + +### タブ幅の調節 +差分やファイルを表示している時、URLに`?ts=4`を追加するとタブを空白4つの幅で表示する。デフォルトは8つだ。`ts`に指定した数で表示されるということだ。これはGistやrawファイルを表示している時には効果を発揮しない。 + +例えば[Goのソースファイル](https://github.com/pengwynn/flint/blob/master/flint/flint.go)を表示している時、`?ts=4`を追加する前はこのように表示されるが: + +![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) + +`?ts=4`を[追加すると](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4)このように表示される: + +![After, tab space example](http://i.imgur.com/70FL4H9.png) + +### 特定のユーザーによるコミット履歴 +特定のユーザーによるあるリポジトリへのコミット履歴のみを参照したい場合は、`?author=username`をURLの末尾に付ける。 + +``` +https://github.com/rails/rails/commits/master?author=dhh +``` +![DHH commit history](http://i.imgur.com/mDWwuaY.png) + +[*コミット・ビューの違いについてもっと詳しく*](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) + +### ブランチ同士の比較 +GitHubのブランチ比較は以下のようなURLで提供されている: + +``` +https://github.com/user/repo/compare/{range} +``` + +`{range}`を`master...4-1-stable`に変更する。 + +例えば: + +``` +https://github.com/rails/rails/compare/master...4-1-stable +``` +![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) + +`{range}`には以下のように変更することもできる: + +``` +https://github.com/rails/rails/compare/master@{1.day.ago}...master +https://github.com/rails/rails/compare/master@{2014-10-04}...master +``` + +*日付の形式は`YYYY-DD-MM`だ。* + +![Another compare example](http://i.imgur.com/5dtzESz.png) + +するとmasterブランチと特定の期間または日時との比較が行えるだろう。 + +[*時間を指定してのブランチ比較についてもっと詳しく*](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 +``` + +![Forked branch compare](http://i.imgur.com/Q1W6qcB.png) + +### Gists +[Gists](https://gist.github.com/)は少量のコード群を管理する最適な手段だ。ちゃんとしたリポジトリをいちいち作成する必要はない。 + +![Gist](http://i.imgur.com/VkKI1LC.png?1) + +GistのURLの最後に`.pibb`を付ける([例](https://gist.github.com/hail2u/9477708.pibb))と*HTMLのみ*のバージョンが表示されるので、そのソースは他のウェブサイトに貼り付けるにはもってこいだろう。 + +簡単なものとはいえ、完全なGitリポジトリとして機能するため、以下のようにすれば普通のGitリポジトリと同じようにクローンすることができる: + +```bash +$ git clone https://gist.github.com/tiimgreen/10545817 +``` + +![Gists](http://i.imgur.com/dULZXXo.png) + +[*Gistの作成についてもっと詳しく*](https://help.github.com/articles/creating-gists) + +### Git.io +[Git.io](http://git.io)はGitHubの提供するGitHub専用のシンプルな短縮URLサービスだ。 + +![Git.io](http://i.imgur.com/6JUfbcG.png?1) + +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`を押すとコマンド・バーにフォーカスが当たる。 + - イシュー画面で`l`を押すとラベルの編集インターフェイスが開かれる。 + - __ファイルを参照している時__(例: `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`)に`y`を押すと、参照している時の状態で固定されるURLに変更される。つまりそのファイルのコードが後に変化したとしても、そのURLでは今とまったく同じ状態で表示されるということだ。 + +`?`を押すとそのページで使える全ショートカットが表示されるだろう。 + +![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) + +[*コマンドバーについてもっと詳しく*](https://help.github.com/articles/using-the-command-bar) + +### コードの指定行の強調 +コードのURLの末尾に`#L52`と付けるか行番号をクリックすると、その行が強調表示される。 + +これは範囲指定も可能だ(例: `#L53-L60`)。こういった範囲を選択するには`shift`を押しながら二つの行をクリックしても良い: + +``` +https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 +``` + +![Line Highlighting](http://i.imgur.com/8AhjrCz.png) + +### コミットからイシューを閉じる +あるコミットでイシューを解決した場合、コミットメッセージで`fix/fixes/fixed`や`close/closes/closed`、`resolve/resolves/resolved`に続けてイシュー番号を指定すると、そのコミットがmasterブランチにpushされると同時に指定イシューが閉じられるだろう。 + +```bash +$ git commit -m "Fix screwup, fixes #12" +``` + +こうするとイシュー#12が閉じられ、閉じたイシューにはそのコミットへの参照が自動的に追加される。 + +![Closing Repo](http://i.imgur.com/Uh1gZdx.png) + +[*コミット・メッセージからイシューを閉じる方法についてもっと詳しく*](https://help.github.com/articles/closing-issues-via-commit-messages) + +### イシューの相互リンク +同じリポジトリの違うイシューへリンクを張り参照させたい場合、`#`に続けてイシュー番号を指定する。そうすると自動的にリンクが作成されるだろう。 + +別のリポジトリのイシューの場合は`user_name/repo_name#ISSUE_NUMBER`とすれば良い(例: `tiimgreen/toc#12`)。 + +![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) + +### プルリクエストでのCI結果の表示 +適切に設定を行えばプルリクエストを受け取るたびに、通常のコミットと同じように[Travis CI](https://travis-ci.org/)がそのプルリクエストをビルドするだろう。どう設定するかは[Travis CI: Getting started](http://docs.travis-ci.com/user/getting-started/)を読むと良い。 + +[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) + +[*コミット・ステータスAPIについてもっと詳しく*](https://github.com/blog/1227-commit-status-api) + +### 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はプルリクエストやイシュー、READMEなどで`:name_of_emoji:`と書くと利用できる: + +``` +:smile: +``` + +こう書くと以下のように表示される: + +:smile: + +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)で確認できる。 + +GitHubで使われているEmojiのトップ5は以下の通りだ: + +1. :shipit: - `:shipit:` +2. :sparkles: - `:sparkles:` +3. :-1: - `:-1:` +4. :+1: - `:+1:` +5. :clap: - `:clap:` + +### 画像及びアニメーションGIF +画像やアニメーションGIFはコミットのコメントやREADMEなどで利用できる: + +``` +![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) +``` + +![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) + +あらゆる画像はGitHubでキャッシュされるので、画像のホスティング先が落ちていたとしても変わらず表示されるだろう。 + +#### GitHub Wikiへの画像の添付 +GitHub Wikiで画像を追加する方法がいくつかある。通常のMarkdown記法(前節を参照)はもちろん使える。しかしそれだけではなく、画像の幅と高さを指定する記法も使うことができる: + +```markdown +[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] +``` + +こうすると以下のようになる: + +![Just a screenshot](http://i.imgur.com/J5bMf7S.png) + +### 素早く引用 +イシューのスレッドで他の人のコメントを引用してコメントしたい場合、引用したい文章を選択した状態で`r`を押すと、ブロック引用の記法を使ってテキストエリアにコピーされる。 + +![Quick Quote](http://i.imgur.com/TzpMIOA.png) + +[*素早く引用する方法についてもっと詳しく*](https://github.com/blog/1399-quick-quotes) + +### 設定済みライセンスの追加 +GitHub上でリポジトリを作成する時、あらかじめ設定されているライセンスを追加することもできる: + +![Licese](http://i.imgur.com/Chqj4Fg.png) + +既に存在するリポジトリであってもウェブ上のインターフェイスからファイルを作成することで追加できる。`LICENSE`というファイル名にした場合、ライセンスを選択するオプションが表示されるのだ: + +![License](http://i.imgur.com/fTjQict.png) + +`.gitignore`も同じように作成時に追加することも、後で追加することもできる。 + +[*オープンソース・ライセンスについてもっと詳しく*](https://help.github.com/articles/open-source-licensing) + +### タスクリスト +イシューやプルリクエストでは以下のように(空白に注意)書くとチェックボックスを作成することができる: + +``` +- [ ] Be awesome +- [ ] Do stuff +- [ ] Sleep +``` + +![Task List](http://i.imgur.com/k2qZi56.png) + +これらチェックボックスにチェックが入れられると、同時にMarkdownソースも更新される: + +``` +- [x] Be awesome +- [x] Do stuff +- [ ] Sleep +``` + +[*タスク・リストについてもっと詳しく*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) + +### 相対リンク +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 metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) + +[*文書内のYAMLメタデータの表示についてもっと詳しく*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) + +### 表形式のデータ表示 +GitHubでは`.csv`(カンマ区切り)と`.tsv`(タブ区切り)の形式で書かれた表を整形して表示する機能をサポートしている。 + +![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) + +[*表形式のデーター表示についてもっと詳しく*](https://github.com/blog/1601-see-your-csvs) + +### 差分の表示 +#### レンダリング済みの差分表示 +コミットやプルリクエストにGitHubでレンダリングされて表示されるもの(例: Markdown)が含まれる場合、その*ソース*と*レンダリング済み*の両方の差分を見ることができる。 + +![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) + +レンダリングされた状態での差分を表示したい場合は「Rendered」ボタンをクリックする。レンダリング済みの差分表示では文章の追加や削除、編集がよりわかりやすい: + +![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) + +[*レンダリング済みの差分表示についてもっと詳しく*](https://github.com/blog/1784-rendered-prose-diffs) + +#### マップ差分の可視化 +コミットやプルリクエストにジオデータの変更が含まれている場合はいつも、GitHubではそのジオデータの変化を可視化してくれるだろう。 + +[![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) + +[*マップ差分の可視化についてもっと詳しく*](https://github.com/blog/1772-diffable-more-customizable-maps) + +#### 差分表示の前後を表示 +差分表示の行番号付近にある*展開*ボタンを使うと、その前後の行をクリックして表示させることができる。*展開*ボタンを押し続けることによってファイル全体を表示することもできるし、またこの機能はあらゆるGitHubの差分表示ビューに用意されている。 + +![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) + +[*差分表示の前後を表示についてもっと詳しく*](https://github.com/blog/1705-expanding-context-in-diffs) + +#### プルリクエストの内容をDIFFまたはPATCH形式で取得 +プルリクエストによる差分はその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 + +(...) +``` + + +### 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) + +### 共同開発者との摩擦の軽減 +もし誰かに自分のプロジェクトの利用またはその開発に参加してもらいたい場合、まずはよくある質問に答えることから始めなければならないだろう。このプロジェクトはどういうものなのか?どうやって使うのか?どのように使っても良いのか?どうやれば開発に参加できるのか?どうやれば開発環境を用意できるのか?どうやって自分の加えた機能が既存の機能を破壊しないことが確認できるのか? + +[Friction](https://github.com/rafalchmiel/friction)はこういった[一般的な質問に対しての答え](https://github.com/rafalchmiel/friction/wiki)が用意されているかをチェックしてくれるコマンドライン・ツールだ。例えば以下のような出力を得られる: + +[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) + +### 開発参加のガイドライン +リポジトリのルートに`CONTRIBUTING`という名前のファイルを置くと、イシューやプルリクエストを作成しようとした時にそれへのリンクが表示されるようになる。 + +![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) + +[*開発参加のガイドラインについてもっと詳しく*](https://github.com/blog/1184-contributing-guidelines) + +### GitHub Resources +| 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 +### 直前のブランチ +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) + +### プルリクエストのチェックアウト +プルリクエストをローカル・リポジトリへチェックアウトするには、まず以下のようにコマンドを実行しその変更を取り込む: + +```bash +$ git fetch origin '+refs/pull/*/head:refs/pull/*' +``` + +そして、プルリクエストを番号(例: 42)を指定してチェックアウトする: + +```bash +$ git checkout refs/pull/42 +``` + +別の方法としては、まずプルリクエストをリモート・ブランチとして取り込み: + +```bash +$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' +``` + +それから番号を指定して取り込むこともできる: + +```bash +$ git checkout origin/pr/42 +``` + +またプルリクエストの取り込みは、.git/configに以下の行を追加すると自動化することができる: + + +``` +[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/* +``` + +[*プルリクエストのチェックアウトについてもっと詳しく*](https://help.github.com/articles/checking-out-pull-requests-locally) + +### 空のコミット :trollface: +`--allow-empty`オプションを付けると、コードの変化がなくてもコミットを作成することができる: + +```bash +$ git commit -m "Big-ass commit" --allow-empty +``` + +この機能の使い方(便利なもの)としては以下のようなものが挙げられる: + + - 新たな機能や大きな変更を事前に通知する時 + - コード上に現れないような変更をプロジェクトに加えた時 + - リポジトリを利用して誰かと連絡を取りたい時 + - リポジトリへの最初のコミットをやり直しできるようにしたい時: `git commit -m "init repo" --allow-empty`. + +### Gitステータスのスタイリング +普通に実行すると: + +```bash +$ git status +``` + +このように表示されるが: + +![git status](http://i.imgur.com/o3PEHAA.png) + +`-sb`を追加することによって: + +```bash +$ git status -sb +``` + +このように表示することもできる: + +![git status -sb](http://i.imgur.com/xNI1bT0.png) + +[*Gitの`status`コマンドについてもっと詳しく*](http://git-scm.com/docs/git-status) + +### Gitログのスタイリング +以下のように実行すると: + +```bash +$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative +``` + +このように表示される: + +![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) + +この設定は[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 +``` +![git show :/query](http://i.imgur.com/icaGiNt.png) + +注: 終了するには`q`を押す。 + +### マージ済みブランチ +以下のように実行すると: + +```bash +$ git branch --merged +``` + +現在のブランチに既にマージされたブランチの一覧が表示される。 + +逆に: + +```bash +$ git branch --no-merged +``` + +こうするとまだマージされていないブランチが表示されるだろう。 + +[*Gitの`branch`コマンドについてもっと詳しく*](http://git-scm.com/docs/git-branch) + +### ローカル・リポジトリを参照するウェブサーバー +Gitの`instaweb`コマンドを利用すると、自分の作業リポジトリを`gitweb`で参照することができる。このコマンドは`gitweb`とウェブサーバーをセットアップしてローカル・リポジトリをブラウザーで開けるようにする簡単なスクリプトだ。 + +```bash +$ git instaweb +``` + +以下のようなページが開かれる: + +![Git instaweb](http://i.imgur.com/Dxekmqc.png) + +[*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 remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | + +#### コマンドの自動修正 +多分今は`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 Resources +| 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/ | +| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | +| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | +| Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | + +#### 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 Peepcode | http://peepcode.com/products/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)の日本語訳である。 From d6e4a8311cd435e3df3f3e883e6f79b1670c2eff Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Thu, 24 Apr 2014 06:04:53 +0900 Subject: [PATCH 098/292] Add link to Japanese translation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f7cd043..8e23def 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GitHub Cheat Sheet A collection of cool hidden and not so 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)). -*Read this in [Korean](README.ko.md).* +*Read this in [Korean](README.ko.md) or [Japanese](README.ja.md).* ## Table of Contents - [GitHub](#github) From ecf6946df2dfe4e8543465e6f1020ed2b29742a2 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 23 Apr 2014 22:23:20 +0100 Subject: [PATCH 099/292] Update CONTRIBUTING for translation contributions --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 49f87d9..8a358cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,3 +14,4 @@ - Make sure to include examples wherever possible (preferably GIFs). - For command-line examples, wrap your commands in a `bash` code block. Ask [@rafalchmiel](https://github.com/rafalchmiel) or [@tiimgreen](https://github.com/tiimgreen) to take a screenshot (so that it is consistent with the rest) of the output if it has color, etc. - At the end of your section, add a `Read more about...` link. This should directly link to [Git's](http://git-scm.com/docs) or [GitHub's](https://help.github.com/) documentation. +- If your contribution is a translation, add a (relative) link to the README above the [Table of Contents](README.md#table-of-contents). From c944a57500fd46d2efe25f88dbd9734d57220484 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Thu, 24 Apr 2014 10:40:07 +0900 Subject: [PATCH 100/292] Update korean translation --- README.ko.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.ko.md b/README.ko.md index c35e549..4719d37 100644 --- a/README.ko.md +++ b/README.ko.md @@ -2,6 +2,8 @@ A collection of cool hidden and not so 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)). +*Read this in other languages: [English](README.md) [한국어](README.ko.md) or [日本語](README.ja.md).* + # 목록 - [GitHub](#github) @@ -75,7 +77,7 @@ diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값 ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) 그리고 `?ts=4`를 붙인 [다음에는](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4) 이렇게 됩니다. - + --allow-empty ![After, tab space example](http://i.imgur.com/70FL4H9.png) ### Commit History by Author @@ -220,12 +222,12 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L 어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`, `close/closes/closed`, `resolve/resolves/resolved`를 키워드로 해당 이슈가 마스터 브랜치에 커밋 될 때 닫을 수 있습니다. ```bash -$ git commit -m "Fix cock up, fixes #12" +$ git commit -m "Fix screwup, fixes #12" ``` 이렇게 하면 이슈를 닫고 클로징 커맨트로 참조하게 합니다. -![Closing Repo](http://i.imgur.com/URXFprQ.png) +![Closing Repo](http://i.imgur.com/Uh1gZdx.png) [*커밋 메세지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages) @@ -612,6 +614,7 @@ $ git commit -m "Big-ass commit" --allow-empty - 한 뭉치의 일을 시작하기 전에 주석으로 사용 - 코드와 관련없는 프로젝트 수정을 할때 주석으로 사용 - 저장소를 사용하는 사람과의 대화 + - 나중에 리베이스하지 않을 저장소의 첫 커밋으로 사용 `git commit -m "init repo" --allow-empty`. ### Styled Git Status From 2a18c4cc05d6c36e855b06c37756ce5f32c991a6 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Thu, 24 Apr 2014 10:44:43 +0900 Subject: [PATCH 101/292] Localize language switcher --- README.ja.md | 2 ++ README.ko.md | 2 +- README.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index 2565eed..735f2d9 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,6 +1,8 @@ # GitHubカンニング・ペーパー これは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))の二つのトークを元にしている。 +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* + # 目次 - [GitHub](#github) - [空白の無視](#%E7%A9%BA%E7%99%BD%E3%81%AE%E7%84%A1%E8%A6%96) diff --git a/README.ko.md b/README.ko.md index 4719d37..3ddc32d 100644 --- a/README.ko.md +++ b/README.ko.md @@ -2,7 +2,7 @@ A collection of cool hidden and not so 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)). -*Read this in other languages: [English](README.md) [한국어](README.ko.md) or [日本語](README.ja.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* # 목록 diff --git a/README.md b/README.md index 8e23def..89a47e8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GitHub Cheat Sheet A collection of cool hidden and not so 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)). -*Read this in [Korean](README.ko.md) or [Japanese](README.ja.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* ## Table of Contents - [GitHub](#github) From 482d18e313bda155eff178d1fb61d23f53fabee3 Mon Sep 17 00:00:00 2001 From: wolfg1969 Date: Mon, 28 Apr 2014 18:21:30 +0800 Subject: [PATCH 102/292] start zh-cn translation --- README.zh-cn.md | 761 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 761 insertions(+) create mode 100644 README.zh-cn.md diff --git a/README.zh-cn.md b/README.zh-cn.md new file mode 100644 index 0000000..89a47e8 --- /dev/null +++ b/README.zh-cn.md @@ -0,0 +1,761 @@ +# GitHub Cheat Sheet +A collection of cool hidden and not so 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)). + +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* + +## Table of Contents + - [GitHub](#github) + - [Ignore Whitespace](#ignore-whitespace) + - [Adjust Tab Space](#adjust-tab-space) + - [Commit History by Author](#commit-history-by-author) + - [Cloning a Repository](#cloning-a-repository) + - [Comparing Branches](#comparing-branches) + - [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories) + - [Gists](#gists) + - [Git.io](#gitio) + - [Keyboard Shortcuts](#keyboard-shortcuts) + - [Line Highlighting in Repositories](#line-highlighting-in-repositories) + - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) + - [Cross-Link Issues](#cross-link-issues) + - [CI Status on Pull Requests](#ci-status-on-pull-requests) + - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) + - [Emojis](#emojis) + - [Images/GIFs](#imagesgifs) + - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) + - [Quick Quoting](#quick-quoting) + - [Quick Licensing](#quick-licensing) + - [Task Lists](#task-lists) + - [Relative Links](#relative-links) + - [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) + - [Diffs](#diffs) + - [Rendered prose Diffs](#rendered-prose-diffs) + - [Diffable Maps](#diffable-maps) + - [Expanding Context in Diffs](#expanding-context-in-diffs) + - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) + - [Hub](#hub) + - [Decreasing Contributor Friction](#decreasing-contributor-friction) + - [Contributing Guidelines](#contributing-guidelines) + - [GitHub Resources](#github-resources) + - [GitHub Talks](#github-talks) + - [Git](#git) + - [Previous Branch](#previous-branch) + - [Stripspace](#stripspace) + - [Checking out Pull Requests](#checking-out-pull-requests) + - [Empty Commits :trollface:](#empty-commits-trollface) + - [Styled Git Status](#styled-git-status) + - [Styled Git Log](#styled-git-log) + - [Git Query](#git-query) + - [Merged Branches](#merged-branches) + - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) + - [Git Configurations](#git-configurations) + - [Aliases](#aliases) + - [Auto-Correct](#auto-correct) + - [Color](#color) + - [Git Resources](#git-resources) + - [Git Books](#git-books) + +## GitHub +### Ignore Whitespace +Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed. + +![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) + +[*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) + +### Adjust Tab Space +Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views. + +Here is a Go source file [before](https://github.com/pengwynn/flint/blob/master/flint/flint.go) adding `?ts=4`: + +![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) + +...and this is [after](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4) adding `?ts=4`: + +![After, tab space example](http://i.imgur.com/70FL4H9.png) + +### Commit History by Author +To view all commits on a repo by author add `?author=username` to the URL. + +``` +https://github.com/rails/rails/commits/master?author=dhh +``` + +![DHH commit history](http://i.imgur.com/mDWwuaY.png) + +[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) + +### Cloning a Repository +When cloning a repository the `.git` can be left off the end. + +```bash +$ git clone https://github.com/tiimgreen/github-cheat-sheet +``` + +[*Read more about the Git `clone` command.*](http://git-scm.com/docs/git-clone) + +### Comparing Branches +To use GitHub to compare branches, change the URL to look like this: + +``` +https://github.com/user/repo/compare/{range} +``` + +Where `{range} = master...4-1-stable` + +For example: + +``` +https://github.com/rails/rails/compare/master...4-1-stable +``` + +![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) + +`{range}` can be changed to things like: + +``` +https://github.com/rails/rails/compare/master@{1.day.ago}...master +https://github.com/rails/rails/compare/master@{2014-10-04}...master +``` + +*Dates are in the format `YYYY-DD-MM`* + +![Another compare example](http://i.imgur.com/5dtzESz.png) + +...which allows you to see the difference on the master branch up a set time ago or a specified date. + +[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) + +### Compare Branches across Forked Repositories +To use GitHub to compare branches across forked repositories, change the URL to look like this: + +``` +https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +``` + +For example: + +``` +https://github.com/rails/rails/compare/byroot:master...master +``` + +![Forked branch compare](http://i.imgur.com/Q1W6qcB.png) + +### Gists +[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repository. + +![Gist](http://i.imgur.com/VkKI1LC.png?1) + +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. + +Gists can be treated as a full repository so they can be cloned like any other: + +```bash +$ git clone https://gist.github.com/tiimgreen/10545817 +``` + +![Gists](http://i.imgur.com/dULZXXo.png) + +[*Read more about creating gists.*](https://help.github.com/articles/creating-gists) + +### Git.io +[Git.io](http://git.io) is a simple URL shortener for GitHub. + +![Git.io](http://i.imgur.com/6JUfbcG.png?1) + +You can also use it via pure HTTP using 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/... +``` + +[*Read more about Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) + +### Keyboard Shortcuts +When on a repository page, keyboard shortcuts allow you to navigate easily. + + - Pressing `t` will bring up a file explorer. + - Pressing `w` will bring up the branch selector. + - Pressing `s` will select the Command Bar. + - Pressing `l` will edit labels on existing Issues. + - 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. + +To see all of the shortcuts for the current page press `?`: + +![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) + +[*Read more about using the Command Bar.*](https://help.github.com/articles/using-the-command-bar) + +### Line Highlighting in Repositories +Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. + +It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines: + +``` +https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 +``` + +![Line Highlighting](http://i.imgur.com/8AhjrCz.png) + +### Closing Issues via Commit Messages +If a particular commit fixes an issue, any of the keywords `fix/fixes/fixed`, `close/closes/closed` or `resolve/resolves/resolved`, followed by the issue number, will close the issue once it is committed to the master branch. + +```bash +$ git commit -m "Fix screwup, fixes #12" +``` + +This closes the issue and references the closing commit. + +![Closing Repo](http://i.imgur.com/Uh1gZdx.png) + +[*Read more about closing Issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) + +### Cross-Link Issues +If you want to link to another issue in the same repository, simple type hash `#` then the issue number, it will be auto-linked. + +To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. + +![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) + +### CI Status on Pull Requests +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/). + +[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) + +[*Read more about the commit status API.*](https://github.com/blog/1227-commit-status-api) + +### Syntax Highlighting in Markdown Files +For example, to syntax highlight Ruby code in your Markdown files write: + + ```ruby + require 'tabbit' + table = Tabbit.new('Name', 'Email') + table.add_row('Tim Green', 'tiimgreen@gmail.com') + puts table.to_s + ``` + +This will produce: + +```ruby +require 'tabbit' +table = Tabbit.new('Name', 'Email') +table.add_row('Tim Green', 'tiimgreen@gmail.com') +puts table.to_s +``` + +GitHub uses [Linguist](https://github.com/github/linguist) to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing the [languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml). + +[*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) + +### Emojis +Emojis can added to on Pull Requests, Issues, commit messages, Markdown files, etc. using `:name_of_emoji:`: + +``` +:smile: +``` + +Would produce: + +:smile: + +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). + +The top 5 used Ejmojis on GitHub are: + +1. :shipit: - `:shipit:` +2. :sparkles: - `:sparkles:` +3. :-1: - `:-1:` +4. :+1: - `:+1:` +5. :clap: - `:clap:` + +### Images/GIFs +Images and GIFs can be added to comments, READMEs etc.: + +``` +![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) +``` + +![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) + +All images are cached on GitHub, so if your host goes down, the image will remain available. + +#### Embedding Images in GitHub Wiki +There are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax (shown above). But there's also a syntax that allows things like specifying the height or width of the image: + +```markdown +[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] +``` + +Which produces: + +![Just a screenshot](http://i.imgur.com/J5bMf7S.png) + +### Quick Quoting +When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. + +![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) + +[*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) + +### Quick Licensing +When creating a repository GitHub gives you the options of adding in a pre-made license: + +![License](http://i.imgur.com/Chqj4Fg.png) + +You can also add them to existing repositories by creating a new file through the web interface. When the name `LICENSE` is typed in you will get an option to use a template: + +![License](http://i.imgur.com/fTjQict.png) + +Also works for `.gitignore`. + +[*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing) + +### Task Lists +In Issues and Pull requests check boxes can be added with the following syntax (notice the space): + +``` +- [ ] Be awesome +- [ ] Do stuff +- [ ] Sleep +``` + +![Task List](http://i.imgur.com/k2qZi56.png) + +When they are clicked, they will be updated in the pure Markdown: + +``` +- [x] Be awesome +- [x] Do stuff +- [ ] Sleep +``` + +[*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) + +### Relative Links +Relative links are recommended in your Markdown files when linking to internal content. + +```markdown +[Link to a header](#awesome-section) +[Link to a file](docs/readme) +``` + +Absolute links have to be updated whenever the URL changes (e.g. repository renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own. + +[*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes) + +### Metadata and Plugin Support for GitHub Pages +Within Jekyll pages and posts, repository information is available within the `site.github` namespace, and can be displayed, for example, using `{{ site.github.project_title }}`. + +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. + +[*Read more about repository metadata and plugin support for GitHub Pages.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) + +### Viewing YAML Metadata in your Documents +Many blogging websites, like [Jekyll](http://jekyllrb.com/) with [GitHub Pages](http://pages.github.com/), depend on some YAML-formatted metadata at the beginning of your post. GitHub will render this metadata as a horizontal table, for easier reading + +![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) + +[*Read more about viewing YAML metadata in your documents.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) + +### Rendering Tabular Data +GitHub supports rendering tabular data in the form of `.csv` (comma-separated) and `.tsv` (tab-separated) files. + +![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) + +[*Read more about rendering tabular data.*](https://github.com/blog/1601-see-your-csvs) + +### Diffs +#### Rendered Prose Diffs +Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views. + +![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) + +Click the "rendered" button to see the changes as they'll appear in the rendered document. Rendered prose view is handy when you're adding, removing, and editing text: + +![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) + +[*Read more about rendered prose diffs.*](https://github.com/blog/1784-rendered-prose-diffs) + +#### Diffable Maps +Any time you view a commit or pull request on GitHub that includes geodata, GitHub will render a visual representation of what was changed. + +[![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) + +[*Read more about diffable maps.*](https://github.com/blog/1772-diffable-more-customizable-maps) + +#### Expanding Context in Diffs +Using the *unfold* button in the gutter of a diff, you can reveal additional lines of context with a click. You can keep clicking *unfold* until you've revealed the whole file, and the feature is available anywhere GitHub renders diffs. + +![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) + +[*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs) + +#### Diff or Patch of Pull Request +You can get the diff of a Pull Request by adding a `.diff` or `.patch` +extension to the end of the URL. For example: + +``` +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 +``` + +The `.diff` extension would give you this in plain text: + +``` +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 + +(...) +``` + +### Hub +[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. + +This allows you to do things like: + +```bash +$ hub clone tiimgreen/toc +``` + +[*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) + +### Decreasing Contributor Friction +If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? + +[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common [answers to these questions](https://github.com/rafalchmiel/friction/wiki). This is some example output: + +[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) + +*Friction supports MRI 2.1.0, MRI 2.0.0, and MRI 1.9.3.* + +### Contributing Guidelines +Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. + +![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) + +[*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) + +### GitHub Resources +| 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 +### Previous Branch +To move to the previous branch in Git: + +```bash +$ git checkout - +# Switched to branch 'master' + +$ git checkout - +# Switched to branch 'next' + +$ git checkout - +# Switched to branch 'master' +``` + +[*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) + +### Stripspace + +Git Stripspace: + +- Strips trailing whitespace +- Collapses newlines +- Adds newline to end of file + +A file must be passed when calling the command, e.g.: +```bash +$ git stripspace < README.md +``` + +[*Read more about the Git `stripspace` command.*](http://git-scm.com/docs/git-stripspace) + +### Checking out Pull Requests +If you want to check out pull request locally, you can fetch it using that command: + +```bash +$ git fetch origin '+refs/pull/*/head:refs/pull/*' +``` + +then, checkout Pull Request (i.e. 42) using + +```bash +$ git checkout refs/pull/42 +``` + +Alternatively, you can fetch them as remote branches: + +```bash +$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' +``` + +and checkout as: + +```bash +$ git checkout origin/pr/42 +``` + +and even fetch them automatically, if you add corresponding lines in your .git/config: + + +``` +[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/* +``` + +[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) + +### Empty Commits :trollface: +Commits can be pushed with no code changes by adding `--allow-empty`: + +```bash +$ git commit -m "Big-ass commit" --allow-empty +``` + +Some use-cases for this (that make sense), include: + + - Annotating the start of a new bulk of work or a new feature. + - Documenting when you make changes to the project that aren't code related. + - Communicating with people using your repository. + - The first commit of a repo, as the first commit cannot be rebased later: `git commit -m "init repo" --allow-empty`. + +### Styled Git Status +Running: + +```bash +$ git status +``` + +Produces: + +![git status](http://i.imgur.com/o3PEHAA.png) + +By adding `-sb`: + +```bash +$ git status -sb +``` + +This is produced: + +![git status -sb](http://i.imgur.com/xNI1bT0.png) + +[*Read more about the Git `status` command.*](http://git-scm.com/docs/git-status) + +### Styled Git Log +Running: + +```bash +$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative +``` + +Produces: + +![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) + +Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) + +*This can be aliased using the instructions found [here](https://github.com/tiimgreen/github-cheat-sheet#aliases).* + +[*Read more about the Git `log` command.*](http://git-scm.com/docs/git-log) + +### Git Query +A Git query allows you to search all your previous commit messages and find the most recent one matching the query. + +```bash +$ git show :/query +``` + +Where `query` (case-sensitive) is the term you want to search, this then finds the last one and gives details on the lines that were changed. + +```bash +$ git show :/typo +``` +![git show :/query](http://i.imgur.com/icaGiNt.png) + +*Press `q` to quit.* + +### Merged Branches +Running: + +```bash +$ git branch --merged +``` + +Will give you a list of all branches that have been merged into your current branch. + +Conversely: + +```bash +$ git branch --no-merged +``` + +Will give you a list of branches that have not been merged into your current branch. + +[*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch) + +### Web Server for Browsing Local Repositories +Use the Git `instaweb` command to instantly browse your working repository in `gitweb`. This command is a simple script to set up `gitweb` and a web server for browsing the local repository. + +```bash +$ git instaweb +``` + +Opens: + +![Git instaweb](http://i.imgur.com/Dxekmqc.png) + +[*Read more about the Git `instaweb` command.*](http://git-scm.com/docs/git-instaweb) + +### Git Configurations +Your `.gitconfig` file contains all your Git configurations. + +#### Aliases +Aliases are helpers that let you define your own git calls. For example you could set `git a` to run `git add --all`. + +To add an alias, either navigate to `~/.gitconfig` and fill it out in the following format: + +``` +[alias] + co = checkout + cm = commit + p = push + # Show verbose output about tags, branches or remotes + tags = tag -l + branches = branch -a + remotes = remote -v +``` + +...or type in the command-line: + +```bash +$ git config --global alias.new_alias git_function +``` + +For example: + +```bash +$ git config --global alias.cm commit +``` + +For an alias with multiple functions use quotes: + +```bash +$ git config --global alias.ac 'add -A . && commit' +``` + +Some useful aliases include: + +| Alias | Command | What to Type | +| --- | --- | --- | +| `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 remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | + +#### Auto-Correct +If you type `git comit` you will get this: + +```bash +$ git comit -m "Message" +# git: 'comit' is not a git command. See 'git --help'. + +# Did you mean this? +# commit +``` + +To call `commit` when `comit` is typed, just enable auto-correct: + +```bash +$ git config --global help.autocorrect 1 +``` + +So now you will get this: + +```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... +``` + +#### Color +To add more color to your Git output: + +```bash +$ git config --global color.ui 1 +``` + +[*Read more about the Git `config` command.*](http://git-scm.com/docs/git-config) + +### Git Resources +| 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/ | +| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | +| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | +| Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | + +#### 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 Peepcode | http://peepcode.com/products/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 | From 2f9c842cdcd76a41661862a9b8ea8bfd3f1690b2 Mon Sep 17 00:00:00 2001 From: Philippe Miossec Date: Mon, 28 Apr 2014 18:01:49 +0200 Subject: [PATCH 103/292] Update git log style Improve readability with Different colors for different refs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89a47e8..c0a2717 100644 --- a/README.md +++ b/README.md @@ -589,12 +589,12 @@ This is produced: Running: ```bash -$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative +$ 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 ``` Produces: -![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) +![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](http://i.imgur.com/R2z8l7c.png) Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) From cf3ed62cd7bdbe3e1a181a18a8de592934f64f25 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 28 Apr 2014 17:31:31 +0100 Subject: [PATCH 104/292] Update screenshot, as mentioned in #39 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0a2717..86e793b 100644 --- a/README.md +++ b/README.md @@ -594,7 +594,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %C Produces: -![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](http://i.imgur.com/R2z8l7c.png) +![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](http://i.imgur.com/EARRQyJ.png) Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) From 20bad39c3784c5dd3a45f4a6746d6d1c4df75cdd Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 28 Apr 2014 19:15:16 +0100 Subject: [PATCH 105/292] Read only task lists in markdown documents --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 86e793b..080f6ac 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Quick Quoting](#quick-quoting) - [Quick Licensing](#quick-licensing) - [Task Lists](#task-lists) + - [Task Lists in Markdown Documents](#task-lists-in-markdown-documents) - [Relative Links](#relative-links) - [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) @@ -338,6 +339,25 @@ When they are clicked, they will be updated in the pure Markdown: [*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +### Task Lists in Markdown Documents +In full Markdown documents **read-only** checklists can now be added using the following syntax: + +``` +- [ ] Mercury +- [ ] Venus +- [x] Earth +- [x] Mars +- [ ] Jupiter +``` + +- [ ] Mercury +- [ ] Venus +- [x] Earth +- [x] Mars +- [ ] Jupiter + +[*Read more about task lists in markdown documents.*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) + ### Relative Links Relative links are recommended in your Markdown files when linking to internal content. From 71cce091bcb1faf6d9e4e56279af5de3911887cb Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 28 Apr 2014 19:16:07 +0100 Subject: [PATCH 106/292] Update task list in markdown documents --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 080f6ac..fbc4ad1 100644 --- a/README.md +++ b/README.md @@ -344,14 +344,14 @@ In full Markdown documents **read-only** checklists can now be added using the f ``` - [ ] Mercury -- [ ] Venus +- [x] Venus - [x] Earth - [x] Mars - [ ] Jupiter ``` - [ ] Mercury -- [ ] Venus +- [x] Venus - [x] Earth - [x] Mars - [ ] Jupiter From 2d70d8f783b03bf62da1fcba0839c922f152b97f Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 28 Apr 2014 19:26:13 +0100 Subject: [PATCH 107/292] Update header for sub-catagory --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fbc4ad1..b0d13d8 100644 --- a/README.md +++ b/README.md @@ -339,7 +339,7 @@ When they are clicked, they will be updated in the pure Markdown: [*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) -### Task Lists in Markdown Documents +#### Task Lists in Markdown Documents In full Markdown documents **read-only** checklists can now be added using the following syntax: ``` From 92141dbd831d58d8f1f3c9a04052858ef920ddf1 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Tue, 29 Apr 2014 13:18:30 +0900 Subject: [PATCH 108/292] Update Japanese translation --- README.ja.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index 735f2d9..d01ae99 100644 --- a/README.ja.md +++ b/README.ja.md @@ -25,6 +25,7 @@ - [素早く引用](#%E7%B4%A0%E6%97%A9%E3%81%8F%E5%BC%95%E7%94%A8) - [設定済みライセンスの追加](#%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) @@ -337,6 +338,25 @@ GitHub上でリポジトリを作成する時、あらかじめ設定されて [*タスク・リストについてもっと詳しく*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +#### 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ファイルでリポジトリ内のコンテンツへ張る場合、相対リンクを利用することが推奨されている。 @@ -592,12 +612,12 @@ $ git status -sb 以下のように実行すると: ```bash -$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative +$ 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 ``` このように表示される: -![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) +![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](http://i.imgur.com/EARRQyJ.png) この設定は[Palesz](http://stackoverflow.com/users/88355/palesz)が考えたものだ。 From 08e1fcd768fa070a38a45027ffbc639c29a45a7a Mon Sep 17 00:00:00 2001 From: Matthew McCullough Date: Mon, 28 Apr 2014 23:13:07 -0700 Subject: [PATCH 109/292] GitHub Training Kit as a resource --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b0d13d8..ec8f5ae 100644 --- a/README.md +++ b/README.md @@ -768,6 +768,7 @@ $ git config --global color.ui 1 | Git for Designer | http://hoth.entp.com/output/git_for_designers.html | | 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 Books | Title | Link | From 628f269d5072960ce843bcaec82fc6614032be30 Mon Sep 17 00:00:00 2001 From: wolfg1969 Date: Mon, 28 Apr 2014 21:12:10 +0800 Subject: [PATCH 110/292] add zh-cn translation --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 500 ++++++++++++++++++++++++------------------------ 4 files changed, 256 insertions(+), 250 deletions(-) diff --git a/README.ja.md b/README.ja.md index 735f2d9..2646143 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,7 +1,7 @@ # GitHubカンニング・ペーパー これは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))の二つのトークを元にしている。 -*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* # 目次 - [GitHub](#github) diff --git a/README.ko.md b/README.ko.md index 3ddc32d..f6549ce 100644 --- a/README.ko.md +++ b/README.ko.md @@ -2,7 +2,7 @@ A collection of cool hidden and not so 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)). -*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* # 목록 diff --git a/README.md b/README.md index 89a47e8..f0b9a92 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GitHub Cheat Sheet A collection of cool hidden and not so 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)). -*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* ## Table of Contents - [GitHub](#github) diff --git a/README.zh-cn.md b/README.zh-cn.md index 89a47e8..dad5fdd 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -1,82 +1,83 @@ -# GitHub Cheat Sheet -A collection of cool hidden and not so 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)). +# GitHub秘籍 +本秘籍收录了一些Git和Github非常酷同时又少有人知的功能。灵感来自于[Zach Holman](https://github.com/holman)在2012年Aloha Ruby Conference和2013年WDCNZ上所做的演讲:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets))和[More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 -*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* ## Table of Contents - - [GitHub](#github) - - [Ignore Whitespace](#ignore-whitespace) - - [Adjust Tab Space](#adjust-tab-space) - - [Commit History by Author](#commit-history-by-author) - - [Cloning a Repository](#cloning-a-repository) - - [Comparing Branches](#comparing-branches) - - [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories) + - [GitHub篇](#github) + - [忽略空白字符](#ignore-whitespace) + - [调整缩进宽度](#adjust-tab-space) + - [查看某个用户的提交历史](#commit-history-by-author) + - [克隆仓库](#cloning-a-repository) + - [比较分支](#comparing-branches) + - [派生仓库之间比较分支](#compare-branches-across-forked-repositories) - [Gists](#gists) - [Git.io](#gitio) - - [Keyboard Shortcuts](#keyboard-shortcuts) - - [Line Highlighting in Repositories](#line-highlighting-in-repositories) - - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) - - [Cross-Link Issues](#cross-link-issues) - - [CI Status on Pull Requests](#ci-status-on-pull-requests) - - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - - [Emojis](#emojis) - - [Images/GIFs](#imagesgifs) - - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - - [Quick Quoting](#quick-quoting) - - [Quick Licensing](#quick-licensing) - - [Task Lists](#task-lists) - - [Relative Links](#relative-links) - - [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) + - [快捷键](#keyboard-shortcuts) + - [高亮显示一行或多行代码](#line-highlighting-in-repositories) + - [通过提交信息关闭Issue](#closing-issues-via-commit-messages) + - [链接Issue](#cross-link-issues) + - [Pull Requests的CI结果](#ci-status-on-pull-requests) + - [在Markdown文件中使用语法高亮](#syntax-highlighting-in-markdown-files) + - [表情符号](#emojis) + - [图片/GIF动画](#imagesgifs) + - [在Github Wiki里嵌入图片](#embedding-images-in-github-wiki) + - [快速引用文本](#quick-quoting) + - [快速选择软件许可](#quick-licensing) + - [任务列表](#task-lists) + - [相对链接](#relative-links) + - [GitHub Pages的元数据和插件支持](#metadata-and-plugin-support-for-github-pages) + - [在文档里查看YAML元数据](#viewing-yaml-metadata-in-your-documents) + - [渲染表格数据](#rendering-tabular-data) - [Diffs](#diffs) - - [Rendered prose Diffs](#rendered-prose-diffs) - - [Diffable Maps](#diffable-maps) - - [Expanding Context in Diffs](#expanding-context-in-diffs) - - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) + - [渲染单调的Diff](#rendered-prose-diffs) + - [可比较地图](#diffable-maps) + - [扩展Diff上下文](#expanding-context-in-diffs) + - [Pull Request的Diff或Patch](#diff-or-patch-of-pull-request) - [Hub](#hub) - - [Decreasing Contributor Friction](#decreasing-contributor-friction) - - [Contributing Guidelines](#contributing-guidelines) - - [GitHub Resources](#github-resources) + - [减少贡献者冲突](#decreasing-contributor-friction) + - [贡献者指南](#contributing-guidelines) + - [GitHub 参考资源](#github-resources) - [GitHub Talks](#github-talks) - - [Git](#git) - - [Previous Branch](#previous-branch) - - [Stripspace](#stripspace) - - [Checking out Pull Requests](#checking-out-pull-requests) - - [Empty Commits :trollface:](#empty-commits-trollface) - - [Styled Git Status](#styled-git-status) - - [Styled Git Log](#styled-git-log) - - [Git Query](#git-query) - - [Merged Branches](#merged-branches) - - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) - - [Git Configurations](#git-configurations) - - [Aliases](#aliases) - - [Auto-Correct](#auto-correct) - - [Color](#color) - - [Git Resources](#git-resources) - - [Git Books](#git-books) - -## GitHub -### Ignore Whitespace -Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed. + - [Git篇](#git) + - [上个分支](#previous-branch) + - [去除空白](#stripspace) + - [检出 Pull Requests](#checking-out-pull-requests) + - [空提交 :trollface:](#empty-commits-trollface) + - [给 Git Status 命令加样式](#styled-git-status) + - [给 Git Log 命令加样式](#styled-git-log) + - [Git 查询](#git-query) + - [已合并的分支](#merged-branches) + - [用于浏览本地参考的Web服务器](#web-server-for-browsing-local-repositories) + - [Git 配置](#git-configurations) + - [别名](#aliases) + - [自动纠错](#auto-correct) + - [颜色](#color) + - [Git 参考资源](#git-resources) + - [Git 书籍](#git-books) + +## GitHub篇 +### 忽略空白字符 + +在任意diff页面的URL后加上`?w=1`,可以去掉那些只是空白字符的变化,使你能更专注于代码的变化。 ![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) -[*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) +[*详见 GitHub secrets.*](https://github.com/blog/967-github-secrets) -### Adjust Tab Space -Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views. +### 调整缩进宽度 +在diff或者file页面的URL后面加上`?ts=4`,这样当显示tab字符的长度时就会是4个空格的长度,不再是默认的8个空格。`ts`后面的数字还可以根据你个人的偏好进行修改。不过,这个小诀窍在Gists页面和raw file页面不起作用。 -Here is a Go source file [before](https://github.com/pengwynn/flint/blob/master/flint/flint.go) adding `?ts=4`: +下面是我们在Go语言的source file页面URL后加`?ts=4`[前](https://github.com/pengwynn/flint/blob/master/flint/flint.go)的例子: ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) -...and this is [after](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4) adding `?ts=4`: +然后是我们添加`?ts=4`[后](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4)的例子: ![After, tab space example](http://i.imgur.com/70FL4H9.png) -### Commit History by Author -To view all commits on a repo by author add `?author=username` to the URL. +### 查看某个用户的提交历史 +查看某个用户的所有提交历史,只需在commits页面URL后加上`?author=username`。 ``` https://github.com/rails/rails/commits/master?author=dhh @@ -84,27 +85,28 @@ https://github.com/rails/rails/commits/master?author=dhh ![DHH commit history](http://i.imgur.com/mDWwuaY.png) -[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) +[*深入了解提交视图之间的区别*](https://help.github.com/articles/differences-between-commit-views) -### Cloning a Repository -When cloning a repository the `.git` can be left off the end. +### 克隆仓库 +当我们克隆某一资源时,可以不要那个`.git`后缀。 ```bash $ git clone https://github.com/tiimgreen/github-cheat-sheet ``` -[*Read more about the Git `clone` command.*](http://git-scm.com/docs/git-clone) +[*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone) -### Comparing Branches -To use GitHub to compare branches, change the URL to look like this: +### 比较分支 + +如果我们想要比较两个分支,可以像下面一样修改URL: ``` https://github.com/user/repo/compare/{range} ``` -Where `{range} = master...4-1-stable` +其中`{range} = master...4-1-stable` -For example: +例如: ``` https://github.com/rails/rails/compare/master...4-1-stable @@ -112,29 +114,30 @@ https://github.com/rails/rails/compare/master...4-1-stable ![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) -`{range}` can be changed to things like: +`{range}`还可以使用下面的形式: ``` https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` -*Dates are in the format `YYYY-DD-MM`* +*日期格式 `YYYY-DD-MM`* ![Another compare example](http://i.imgur.com/5dtzESz.png) -...which allows you to see the difference on the master branch up a set time ago or a specified date. +...这样你就能查看master分支上一段时间或者指定日期内的改动。 + +[*了解更多关于比较跨时间段的提交记录.*](https://help.github.com/articles/comparing-commits-across-time) -[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) +### 派生仓库之间比较分支 -### Compare Branches across Forked Repositories -To use GitHub to compare branches across forked repositories, change the URL to look like this: +想要对派生仓库Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现: ``` https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} ``` -For example: +例如: ``` https://github.com/rails/rails/compare/byroot:master...master @@ -143,13 +146,14 @@ https://github.com/rails/rails/compare/byroot:master...master ![Forked branch compare](http://i.imgur.com/Q1W6qcB.png) ### Gists -[Gists](https://gist.github.com/) are an easy way to work with small bits of code without creating a fully fledged repository. + +[Gists](https://gist.github.com/) 给我们提供了一种不需要创建一个完整的仓库,使小段代码也可以工作的简单方式。 ![Gist](http://i.imgur.com/VkKI1LC.png?1) -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. +Gist的URL后加上`.pibb`,可以得到更适合嵌入到其他网站的HTML版本。 -Gists can be treated as a full repository so they can be cloned like any other: +Gists还可以像任何标准仓库一样被克隆。 ```bash $ git clone https://gist.github.com/tiimgreen/10545817 @@ -157,14 +161,14 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) -[*Read more about creating gists.*](https://help.github.com/articles/creating-gists) +[*进一步了解如何创建 gists.*](https://help.github.com/articles/creating-gists) ### Git.io -[Git.io](http://git.io) is a simple URL shortener for GitHub. +[Git.io](http://git.io)是Github的短网址服务。 ![Git.io](http://i.imgur.com/6JUfbcG.png?1) -You can also use it via pure HTTP using Curl: +你可以通过Curl命令以普通HTTP协议使用它: ```bash $ curl -i http://git.io -F "url=https://github.com/..." @@ -176,27 +180,29 @@ HTTP/1.1 302 Found Location: https://github.com/... ``` -[*Read more about Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) +[*进一步了解 Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) + +### 快捷键 -### Keyboard Shortcuts -When on a repository page, keyboard shortcuts allow you to navigate easily. +在仓库主页上提供了快捷键方便快速导航。 - - Pressing `t` will bring up a file explorer. - - Pressing `w` will bring up the branch selector. - - Pressing `s` will select the Command Bar. - - Pressing `l` will edit labels on existing Issues. - - 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. + - 按 `t` 键会打开一个文件浏览器。 Pressing `t` will bring up a file explorer. + - 按 `w` 键会打开分支选择菜单。 Pressing `w` will bring up the branch selector. + - 按 `s` 键会激活顶端的命令栏 (Command Bar)。Pressing `s` will select the Command Bar. + - 按 `l` 键编辑Issue列表页的标签。 Pressing `l` will edit labels on existing Issues. + - **查看文件内容时**(如:`https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`),按 `y` 键将会冻结这个页面,这样就算代码被修改了也不会影响你当前看到的。 -To see all of the shortcuts for the current page press `?`: +按`?`查看当前页面支持的快捷键列表: ![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) -[*Read more about using the Command Bar.*](https://help.github.com/articles/using-the-command-bar) +[*进一步了解如何使用 Command Bar.*](https://help.github.com/articles/using-the-command-bar) -### Line Highlighting in Repositories -Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. +### 高亮显示一行或多行代码 -It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines: +在代码文件地址后加上`#L52`或者单击行号52都会将第52行代码高亮显示。 + +多行高亮也可以,比如用`#L53-L60`选择范围,或者按住 `shift`键,然后再点击选择的两行。 ``` https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 @@ -204,35 +210,36 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Line Highlighting](http://i.imgur.com/8AhjrCz.png) -### Closing Issues via Commit Messages -If a particular commit fixes an issue, any of the keywords `fix/fixes/fixed`, `close/closes/closed` or `resolve/resolves/resolved`, followed by the issue number, will close the issue once it is committed to the master branch. +### 通过提交信息关闭Issue + +如果某个提交修复了一个Issue,当提交到master分支时,提交信息里可以使用`fix/fixes/fixed`, `close/closes/closed` 或者 `resolve/resolves/resolved`等关键词,后面再跟上Issue号,这样就会关闭这个Issue。 ```bash $ git commit -m "Fix screwup, fixes #12" ``` -This closes the issue and references the closing commit. +这将会关闭Issue #12,并且在Issue讨论列表里关联引用这次提交。 ![Closing Repo](http://i.imgur.com/Uh1gZdx.png) -[*Read more about closing Issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) +[*进一步了解通过提交信息关闭Issue.*](https://help.github.com/articles/closing-issues-via-commit-messages) -### Cross-Link Issues -If you want to link to another issue in the same repository, simple type hash `#` then the issue number, it will be auto-linked. +### 引用Issue +如果你想引用到同一个仓库中的一个Issue,只需使用井号 `#` 加上Issue号,这样就会自动创建到此Issue的链接。 -To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. +要链接到其他仓库的Issue,就使用`user_name/repo_name#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) -### CI Status on Pull Requests -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/). +### Pull Requests的CI结果 +如果配置正确,[Travis CI](https://travis-ci.org/)会为每个你收到的Pull Request执行构建,就像每次提交也会触发构建一样。想了解更多关于Travis CI的信息,请看 [Travis CI入门](http://docs.travis-ci.com/user/getting-started/)。 [![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) -[*Read more about the commit status API.*](https://github.com/blog/1227-commit-status-api) +[*进一步了解 Commit status API.*](https://github.com/blog/1227-commit-status-api) -### Syntax Highlighting in Markdown Files -For example, to syntax highlight Ruby code in your Markdown files write: +### 在Markdown文件中使用语法高亮 +例如,可以像下面这样在你的Markdown文件里为Ruby代码添加语法高亮: ```ruby require 'tabbit' @@ -241,7 +248,7 @@ For example, to syntax highlight Ruby code in your Markdown files write: puts table.to_s ``` -This will produce: +效果像下面这样: ```ruby require 'tabbit' @@ -250,24 +257,24 @@ table.add_row('Tim Green', 'tiimgreen@gmail.com') puts table.to_s ``` -GitHub uses [Linguist](https://github.com/github/linguist) to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing the [languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml). +Github使用 [Linguist](https://github.com/github/linguist) 做语言识别和语法高亮。你可以仔细阅读 [languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml),了解有哪些可用的关键字。 -[*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) +[*进一步了解 GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) -### Emojis -Emojis can added to on Pull Requests, Issues, commit messages, Markdown files, etc. using `:name_of_emoji:`: +### 使用表情符 + +可以在Pull Requests, Issues, 提交消息, Markdown文件里加入表情符。使用方法`:name_of_emoji:` ``` :smile: ``` - -Would produce: +将输出一个笑脸: :smile: -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). +Github支持的完整表情符号列表详见[emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 或 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)。 -The top 5 used Ejmojis on GitHub are: +Github上使用最多的5个表情符号是: 1. :shipit: - `:shipit:` 2. :sparkles: - `:sparkles:` @@ -275,8 +282,8 @@ The top 5 used Ejmojis on GitHub are: 4. :+1: - `:+1:` 5. :clap: - `:clap:` -### Images/GIFs -Images and GIFs can be added to comments, READMEs etc.: +### 使用图片/GIF动画 +注释和README等文件里也可以使用图片和GIF动画: ``` ![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) @@ -284,41 +291,40 @@ Images and GIFs can be added to comments, READMEs etc.: ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) -All images are cached on GitHub, so if your host goes down, the image will remain available. +所有图片都缓存在Gitub,不用担心你的站点不能访问时就看不到图片了。 -#### Embedding Images in GitHub Wiki -There are multiple ways of embedding images in Wiki pages. There's the standard Markdown syntax (shown above). But there's also a syntax that allows things like specifying the height or width of the image: +#### 在Github Wiki里嵌入图片 +有多种方法可以在Wiki页面里嵌入图片。既可以像上一条里那样使用标准的Markdown语法,也可以像下面这样指定图片的高度或宽度: ```markdown [[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] ``` - -Which produces: +结果: ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) -### Quick Quoting -When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. +### 快速引用文本 +在注释话题里引用之前某个人所说的,只需选中文本,然后按 `r`键,想要的就会以引用的形式复制到你的输入框里。 ![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) -[*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) +[*进一步了解快速引用.*](https://github.com/blog/1399-quick-quotes) -### Quick Licensing -When creating a repository GitHub gives you the options of adding in a pre-made license: +### 快速选择软件许可 +创建一个仓库时,Github会为你提供一个预置的软件许可列表: ![License](http://i.imgur.com/Chqj4Fg.png) -You can also add them to existing repositories by creating a new file through the web interface. When the name `LICENSE` is typed in you will get an option to use a template: +对于已有的仓库,可以通过web界面创建文件来添加软件许可。输入`LICENSE`作为文件名后,同样可以从预置的列表中选择一个作为模板。 ![License](http://i.imgur.com/fTjQict.png) -Also works for `.gitignore`. +这个技巧也使用于 `.gitignore` 文件。 -[*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing) +[*进一步了解 open source licensing.*](https://help.github.com/articles/open-source-licensing) -### Task Lists -In Issues and Pull requests check boxes can be added with the following syntax (notice the space): +### 任务列表 +Issues和Pull requests里可以添加复选框,语法如下(注意空白符): ``` - [ ] Be awesome @@ -328,7 +334,7 @@ In Issues and Pull requests check boxes can be added with the following syntax ( ![Task List](http://i.imgur.com/k2qZi56.png) -When they are clicked, they will be updated in the pure Markdown: +当项目被选中时,它对应的Markdown源码也被更新了: ``` - [x] Be awesome @@ -336,78 +342,77 @@ When they are clicked, they will be updated in the pure Markdown: - [ ] Sleep ``` -[*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +[*进一步了解任务列表.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) -### Relative Links -Relative links are recommended in your Markdown files when linking to internal content. +### 相对链接 +Markdown文件里链接到内部内容时推荐使用相对链接。 ```markdown [Link to a header](#awesome-section) [Link to a file](docs/readme) ``` +绝对链接会在URL改变时(例如重命名仓库、用户名改变,建立分支项目)被更新。使用相对链接能够保证你的文档不受此影响。 -Absolute links have to be updated whenever the URL changes (e.g. repository renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own. - -[*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes) +[*进一步了解相对链接.*](https://help.github.com/articles/relative-links-in-readmes) -### Metadata and Plugin Support for GitHub Pages -Within Jekyll pages and posts, repository information is available within the `site.github` namespace, and can be displayed, for example, using `{{ site.github.project_title }}`. +### GitHub Pages的元数据和插件支持 +在Jekyll页面和文章里,仓库信息可在 `site.github` 命名空间下找到,也可以显示出来,例如,使用 `{{ site.github.project_title }}`显示项目标题。 -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. +Jemoji和jekyll-mentions插件为你的Jekyll文章和页面增加了[emoji](#emojis)和[@mentions](https://github.com/blog/821)功能。 -[*Read more about repository metadata and plugin support for GitHub Pages.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) +[*了解更多 GitHub Pages的元数据和插件支持.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) -### Viewing YAML Metadata in your Documents -Many blogging websites, like [Jekyll](http://jekyllrb.com/) with [GitHub Pages](http://pages.github.com/), depend on some YAML-formatted metadata at the beginning of your post. GitHub will render this metadata as a horizontal table, for easier reading +### 在文档里查看YAML元数据 +许多博客站点,比如基于[Jekyll](http://jekyllrb.com/)的[GitHub Pages](http://pages.github.com/),都依赖于一些文章头部的YAML格式的元数据。Github会将其渲染成一个水平表格,方便阅读。 ![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) -[*Read more about viewing YAML metadata in your documents.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) +[*进一步了解 在文档里查看YAML元数据.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) -### Rendering Tabular Data -GitHub supports rendering tabular data in the form of `.csv` (comma-separated) and `.tsv` (tab-separated) files. +### 渲染表格数据 + +GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染成表格数据。 ![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) -[*Read more about rendering tabular data.*](https://github.com/blog/1601-see-your-csvs) +[*进一步了解渲染表格数据.*](https://github.com/blog/1601-see-your-csvs) ### Diffs -#### Rendered Prose Diffs -Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views. +#### 可渲染纯文本Diff + +提交和Pull Requests里包含有Github支持的可渲染文档(比如Markdown)会提供*source* 和 *rendered* 两个视图功能。 ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) -Click the "rendered" button to see the changes as they'll appear in the rendered document. Rendered prose view is handy when you're adding, removing, and editing text: +点击 "rendered" 按钮,看看改动在渲染后的显示效果。当你添加、删除或修改文本时,渲染纯文本视图非常方便。 ![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) -[*Read more about rendered prose diffs.*](https://github.com/blog/1784-rendered-prose-diffs) +[*进一步了解渲染纯文本视图Diffs.*](https://github.com/blog/1784-rendered-prose-diffs) -#### Diffable Maps -Any time you view a commit or pull request on GitHub that includes geodata, GitHub will render a visual representation of what was changed. +#### 可比较地图 +当你在GitHub上查看一个包含地理数据的提交或pull request时,Github可以显示数据变动的视觉表示。 [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) -[*Read more about diffable maps.*](https://github.com/blog/1772-diffable-more-customizable-maps) +[*进一步了解可比较地图.*](https://github.com/blog/1772-diffable-more-customizable-maps) -#### Expanding Context in Diffs -Using the *unfold* button in the gutter of a diff, you can reveal additional lines of context with a click. You can keep clicking *unfold* until you've revealed the whole file, and the feature is available anywhere GitHub renders diffs. +#### 扩展Diff上下文 [ Expanding Context in Diffs ] +你可以通过点击diff边栏里的 *unfold* 按钮来多显示几行上下文。你可以一直点击 *unfold* 按钮直到显示了文件的全部内容。这个功能在所有GitHub产生的diff界面都可以使用。 ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) -[*Read more about expanding context in diffs.*](https://github.com/blog/1705-expanding-context-in-diffs) +[*进一步了解扩展Diff上下文.*](https://github.com/blog/1705-expanding-context-in-diffs) -#### Diff or Patch of Pull Request -You can get the diff of a Pull Request by adding a `.diff` or `.patch` -extension to the end of the URL. For example: +#### Pull Request的Diff或Patch +在Pull Request的URL后面加上 `.diff` 或 `.patch` 的扩展名就可以得到它的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 ``` - -The `.diff` extension would give you this in plain text: +`.diff` 扩展会使用普通文本格式显示如下内容: ``` diff --git a/README.md b/README.md @@ -429,33 +434,34 @@ index 88fcf69..8614873 100644 ``` ### Hub -[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. +[Hub](https://github.com/github/hub)是一个对Git进行了封装的命令行工具,可以帮助你更方便的使用Github。 -This allows you to do things like: +这使得你可以像下面这样进行克隆: ```bash $ hub clone tiimgreen/toc ``` -[*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) +[*查看更多Hub提供的超酷命令.*](https://github.com/github/hub#commands) -### Decreasing Contributor Friction -If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? +### 减少贡献者冲突 +假设你想人们使用你的项目并给你的项目做出贡献,你往往需要回答他们常见问题。这个项目是干什么用的?我如何使用它?允许我怎样使用?我如何为项目出力?我怎样配置开发环境?我怎么能保证新功能不会破坏已有的功能? -[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common [answers to these questions](https://github.com/rafalchmiel/friction/wiki). This is some example output: +[Friction](https://github.com/rafalchmiel/friction)是一个命令行脚本,用来检查你的项目是否[回答了这些问题](https://github.com/rafalchmiel/friction/wiki)。下面是示例输出: [![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) -*Friction supports MRI 2.1.0, MRI 2.0.0, and MRI 1.9.3.* +*Friction 支持 MRI 2.1.0, MRI 2.0.0 和 MRI 1.9.3.* + +### 贡献者指南 -### Contributing Guidelines -Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. +在你的仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建Issue或Pull Request时会看到这个文件的链接。 ![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) -[*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) +[*进一步了解贡献者指南.*](https://github.com/blog/1184-contributing-guidelines) -### GitHub Resources +### GitHub参考资源 | Title | Link | | ----- | ---- | | GitHub Explore | https://github.com/explore | @@ -464,7 +470,7 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y | GitHub Training | http://training.github.com/ | | GitHub Developer | https://developer.github.com/ | -#### GitHub Talks +#### Github演讲 | Title | Link | | ----- | ---- | | How GitHub Uses GitHub to Build GitHub | https://www.youtube.com/watch?v=qyz3jkOBbQY | @@ -473,9 +479,9 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y | 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 -### Previous Branch -To move to the previous branch in Git: +## Git篇 +### 上一个分支 +快速检出上一个分支: ```bash $ git checkout - @@ -488,50 +494,50 @@ $ git checkout - # Switched to branch 'master' ``` -[*Read more about Git branching.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) +[*进一步了解 Git 分支.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) -### Stripspace +### 去除文件里的空白 -Git Stripspace: +Git Stripspace命令可以: -- Strips trailing whitespace -- Collapses newlines -- Adds newline to end of file +- 去掉行尾空白符 +- 多个空行压缩成一行 +- 必要时在文件末尾增加一个空行 + +使用此命令时必须传入一个文件,像这样: -A file must be passed when calling the command, e.g.: ```bash $ git stripspace < README.md ``` -[*Read more about the Git `stripspace` command.*](http://git-scm.com/docs/git-stripspace) +[*进一步了解 Git `stripspace` 命令.*](http://git-scm.com/docs/git-stripspace) -### Checking out Pull Requests -If you want to check out pull request locally, you can fetch it using that command: +### 检出Pull Requests +如果想检出pull requests到本地,可以先用下面的fetch命令: ```bash $ git fetch origin '+refs/pull/*/head:refs/pull/*' ``` -then, checkout Pull Request (i.e. 42) using +然后用checkout命令检查想要的Pull Request(比如42) ```bash $ git checkout refs/pull/42 ``` -Alternatively, you can fetch them as remote branches: +你也可以把它们当作远程分支来fetch: ```bash $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' ``` -and checkout as: +然后这样检出: ```bash $ git checkout origin/pr/42 ``` -and even fetch them automatically, if you add corresponding lines in your .git/config: - +或者干脆在你的.git/config文件里添加如下内容,这样就可以自动获取它们了。 ``` [remote "origin"] @@ -546,117 +552,117 @@ and even fetch them automatically, if you add corresponding lines in your .git/c fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` -[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) +[*进一步了解如何检出pull request到本地.*](https://help.github.com/articles/checking-out-pull-requests-locally) -### Empty Commits :trollface: -Commits can be pushed with no code changes by adding `--allow-empty`: +### 空提交 :trollface: +可以使用`--allow-empty`选项强制创建一个没有任何改动的提交: ```bash $ git commit -m "Big-ass commit" --allow-empty ``` -Some use-cases for this (that make sense), include: +这样做在如下几种情况下是有意义的: - - Annotating the start of a new bulk of work or a new feature. - - Documenting when you make changes to the project that aren't code related. - - Communicating with people using your repository. - - The first commit of a repo, as the first commit cannot be rebased later: `git commit -m "init repo" --allow-empty`. + - 标记一批工作或一个新功能的开始。 + - 记录你对项目进行了跟代码无关的改动。 + - 跟使用你仓库的其他人交流。 + - 作为仓库的第一次提交,因为第一次提交日后是不能被rebase的: `git commit -m "init repo" --allow-empty`. -### Styled Git Status -Running: +### 给Git Status命令加样式 +在命令行输入如下命令: ```bash $ git status ``` -Produces: +可以看到: ![git status](http://i.imgur.com/o3PEHAA.png) -By adding `-sb`: +加上`-sb`选项: ```bash $ git status -sb ``` -This is produced: +这回得到: ![git status -sb](http://i.imgur.com/xNI1bT0.png) -[*Read more about the Git `status` command.*](http://git-scm.com/docs/git-status) +[*进一步了解 Git `status` 命令.*](http://git-scm.com/docs/git-status) -### Styled Git Log -Running: +### 给Git Log命令加样式 +输入如下命令: ```bash $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative ``` -Produces: +可以看到: ![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) -Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) +这要归功于[Palesz](http://stackoverflow.com/users/88355/palesz)在stackoverflow的回答。 -*This can be aliased using the instructions found [here](https://github.com/tiimgreen/github-cheat-sheet#aliases).* +*这个命令可以被用作别名,详细做法见[这里](https://github.com/tiimgreen/github-cheat-sheet#aliases)。* -[*Read more about the Git `log` command.*](http://git-scm.com/docs/git-log) +[*进一步了解 Git `log` 命令.*](http://git-scm.com/docs/git-log) -### Git Query -A Git query allows you to search all your previous commit messages and find the most recent one matching the query. +### Git查询 +Git查询运行你在之前的所有提交信息里进行搜索,找到其中和搜索条件相匹配的最近的一条。 ```bash $ git show :/query ``` -Where `query` (case-sensitive) is the term you want to search, this then finds the last one and gives details on the lines that were changed. +这里 `query` (区别大小写)是你想要搜索的词语, 这条命令会找到包含这个词语的最后那个提交并显示变动详情。 ```bash $ git show :/typo ``` ![git show :/query](http://i.imgur.com/icaGiNt.png) -*Press `q` to quit.* +* 按 `q` 键退出命令。* -### Merged Branches -Running: +### 已合并的分支 +输入命令: ```bash $ git branch --merged ``` -Will give you a list of all branches that have been merged into your current branch. +这会显示所有已经合并到你当前分支的分支列表。 -Conversely: +相反地: ```bash $ git branch --no-merged ``` -Will give you a list of branches that have not been merged into your current branch. +会显示所有还没有合并到你当前分支的分支列表。 -[*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch) +[*进一步了解 Git `branch` 命令.*](http://git-scm.com/docs/git-branch) -### Web Server for Browsing Local Repositories -Use the Git `instaweb` command to instantly browse your working repository in `gitweb`. This command is a simple script to set up `gitweb` and a web server for browsing the local repository. +### 用来浏览本地仓库的web服务器 +使用Git的 `instaweb` 可以立即在 `gitweb`中浏览你的工作仓库。这个命令是个简单的脚步,配置了`gitweb`和用来浏览本地仓库的Web服务器。*(译者注:默认需要lighttpd支持)* ```bash $ git instaweb ``` -Opens: +执行后打开: ![Git instaweb](http://i.imgur.com/Dxekmqc.png) -[*Read more about the Git `instaweb` command.*](http://git-scm.com/docs/git-instaweb) +[*进一步了解 Git `instaweb` 命令.*](http://git-scm.com/docs/git-instaweb) -### Git Configurations -Your `.gitconfig` file contains all your Git configurations. +### Git配置 +所有Git配置都保存在你的`.gitconfig` 文件中。 -#### Aliases -Aliases are helpers that let you define your own git calls. For example you could set `git a` to run `git add --all`. +#### 别名 [ Aliases ] +别名用来帮助你定义自己的git命令。比如你可以定义 `git a` 来运行 `git add --all`。 -To add an alias, either navigate to `~/.gitconfig` and fill it out in the following format: +要添加一个别名, 一种方法是打开 `~/.gitconfig` 文件并添加如下内容: ``` [alias] @@ -669,27 +675,27 @@ To add an alias, either navigate to `~/.gitconfig` and fill it out in the follow remotes = remote -v ``` -...or type in the command-line: +...或者在命令行里键入: ```bash $ git config --global alias.new_alias git_function ``` -For example: +例如: ```bash $ git config --global alias.cm commit ``` -For an alias with multiple functions use quotes: +指向多个命令的别名可以用引号来定义: ```bash $ git config --global alias.ac 'add -A . && commit' ``` -Some useful aliases include: +下面列出了一些有用的别名: -| Alias | Command | What to Type | +| 别名 Alias | 命令 Command | 如何设置 What to Type | | --- | --- | --- | | `git cm` | `git commit` | `git config --global alias.cm commit` | | `git co` | `git checkout` | `git config --global alias.co checkout` | @@ -699,8 +705,8 @@ Some useful aliases include: | `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` | | `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | -#### Auto-Correct -If you type `git comit` you will get this: +#### 自动纠错 +如果键入 `git comit` 你会看到如下输出: ```bash $ git comit -m "Message" @@ -710,13 +716,13 @@ $ git comit -m "Message" # commit ``` -To call `commit` when `comit` is typed, just enable auto-correct: +为了在键入 `comit` 调用 `commit`命令,只需启用自动纠错功能: ```bash $ git config --global help.autocorrect 1 ``` -So now you will get this: +现在你就会看到: ```bash $ git comit -m "Message" @@ -725,16 +731,16 @@ $ git comit -m "Message" # in 0.1 seconds automatically... ``` -#### Color -To add more color to your Git output: +#### 颜色 +要在你的Git命令输出里加上颜色的话,可以用如下命令: ```bash $ git config --global color.ui 1 ``` -[*Read more about the Git `config` command.*](http://git-scm.com/docs/git-config) +[*进一步了解 Git `config` 命令.*](http://git-scm.com/docs/git-config) -### Git Resources +### Git参考资源 | Title | Link | | ----- | ---- | | Official Git Site | http://git-scm.com/ | @@ -749,7 +755,7 @@ $ git config --global color.ui 1 | Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | | Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | -#### Git Books +#### Git书籍 | Title | Link | | ----- | ---- | | Pragmatic Version Control Using Git | http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git | From ee59ceb9ed5b5d8bb2c99f40f508c2ad3a02d239 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Tue, 29 Apr 2014 23:44:19 +0900 Subject: [PATCH 111/292] Update Korean to abc27e9c --- README.ko.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/README.ko.md b/README.ko.md index 3ddc32d..10ef419 100644 --- a/README.ko.md +++ b/README.ko.md @@ -27,6 +27,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Quick Quoting](#quick-quoting) - [Quick Licensing](#quick-licensing) - [Task Lists](#task-lists) + - [Task Lists in Markdown Documents](#task-lists-in-markdown-documents) - [Relative Links](#relative-links) - [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) @@ -366,6 +367,25 @@ puts table.to_s [*테스크 리스트에 대해 더 읽어 보세요.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +#### Task Lists in Markdown Documents +이제 마크다운 문서에서 **읽기 전용** 체크리스트를 넣을 수 있습니다. + +``` +- [ ] Mercury +- [x] Venus +- [x] Earth +- [x] Mars +- [ ] Jupiter +``` + +- [ ] Mercury +- [x] Venus +- [x] Earth +- [x] Mars +- [ ] Jupiter + +[*마크다운 문서에서의 테스크 리스트에 대해 더 읽어 보세요.*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) + ### Relative Links 상대 경로 링크는 마크다운 파일이 내부 건탠츠로 링크될 때 추천합니다. @@ -636,11 +656,15 @@ $ git status -sb ### Styled Git Log +이 명령을 실행하면 + ```bash -$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative +$ 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 ``` -![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) +이렇게 보입니다. + +![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](http://i.imgur.com/EARRQyJ.png) [Palesz](http://stackoverflow.com/users/88355/palesz)님 고맙습니다. @@ -802,6 +826,7 @@ $ git config --global color.ui 1 | Git for Designer | http://hoth.entp.com/output/git_for_designers.html | | 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 Books From 550e91316a30ce524ebd738b95a0e3b5d867e604 Mon Sep 17 00:00:00 2001 From: wolfg1969 Date: Wed, 30 Apr 2014 09:19:58 +0800 Subject: [PATCH 112/292] fix relative links --- README.zh-cn.md | 190 ++++++++++++++++++++++++------------------------ 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index dad5fdd..554caba 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -3,61 +3,61 @@ *Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* -## Table of Contents - - [GitHub篇](#github) - - [忽略空白字符](#ignore-whitespace) - - [调整缩进宽度](#adjust-tab-space) - - [查看某个用户的提交历史](#commit-history-by-author) - - [克隆仓库](#cloning-a-repository) - - [比较分支](#comparing-branches) - - [派生仓库之间比较分支](#compare-branches-across-forked-repositories) +# 目录 + - [GitHub](#github) + - [Ignore Whitespace](#ignore-whitespace) + - [Adjust Tab Space](#adjust-tab-space) + - [Commit History by Author](#commit-history-by-author) + - [Cloning a Repository](#cloning-a-repository) + - [Comparing Branches](#comparing-branches) + - [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories) - [Gists](#gists) - [Git.io](#gitio) - - [快捷键](#keyboard-shortcuts) - - [高亮显示一行或多行代码](#line-highlighting-in-repositories) - - [通过提交信息关闭Issue](#closing-issues-via-commit-messages) - - [链接Issue](#cross-link-issues) - - [Pull Requests的CI结果](#ci-status-on-pull-requests) - - [在Markdown文件中使用语法高亮](#syntax-highlighting-in-markdown-files) - - [表情符号](#emojis) - - [图片/GIF动画](#imagesgifs) - - [在Github Wiki里嵌入图片](#embedding-images-in-github-wiki) - - [快速引用文本](#quick-quoting) - - [快速选择软件许可](#quick-licensing) - - [任务列表](#task-lists) - - [相对链接](#relative-links) - - [GitHub Pages的元数据和插件支持](#metadata-and-plugin-support-for-github-pages) - - [在文档里查看YAML元数据](#viewing-yaml-metadata-in-your-documents) - - [渲染表格数据](#rendering-tabular-data) + - [Keyboard Shortcuts](#keyboard-shortcuts) + - [Line Highlighting in Repositories](#line-highlighting-in-repositories) + - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) + - [Cross-Link Issues](#cross-link-issues) + - [CI Status on Pull Requests](#ci-status-on-pull-requests) + - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) + - [Emojis](#emojis) + - [Images/GIFs](#imagesgifs) + - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) + - [Quick Quoting](#quick-quoting) + - [Quick Licensing](#quick-licensing) + - [Task Lists](#task-lists) + - [Relative Links](#relative-links) + - [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) - [Diffs](#diffs) - - [渲染单调的Diff](#rendered-prose-diffs) - - [可比较地图](#diffable-maps) - - [扩展Diff上下文](#expanding-context-in-diffs) - - [Pull Request的Diff或Patch](#diff-or-patch-of-pull-request) + - [Rendered prose Diffs](#rendered-prose-diffs) + - [Diffable Maps](#diffable-maps) + - [Expanding Context in Diffs](#expanding-context-in-diffs) + - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - [Hub](#hub) - - [减少贡献者冲突](#decreasing-contributor-friction) - - [贡献者指南](#contributing-guidelines) - - [GitHub 参考资源](#github-resources) + - [Decreasing Contributor Friction](#decreasing-contributor-friction) + - [Contributing Guidelines](#contributing-guidelines) + - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - - [Git篇](#git) - - [上个分支](#previous-branch) - - [去除空白](#stripspace) - - [检出 Pull Requests](#checking-out-pull-requests) - - [空提交 :trollface:](#empty-commits-trollface) - - [给 Git Status 命令加样式](#styled-git-status) - - [给 Git Log 命令加样式](#styled-git-log) - - [Git 查询](#git-query) - - [已合并的分支](#merged-branches) - - [用于浏览本地参考的Web服务器](#web-server-for-browsing-local-repositories) - - [Git 配置](#git-configurations) - - [别名](#aliases) - - [自动纠错](#auto-correct) - - [颜色](#color) - - [Git 参考资源](#git-resources) - - [Git 书籍](#git-books) - -## GitHub篇 -### 忽略空白字符 + - [Git](#git) + - [Previous Branch](#previous-branch) + - [Stripspace](#stripspace) + - [Checking out Pull Requests](#checking-out-pull-requests) + - [Empty Commits :trollface:](#empty-commits-trollface) + - [Styled Git Status](#styled-git-status) + - [Styled Git Log](#styled-git-log) + - [Git Query](#git-query) + - [Merged Branches](#merged-branches) + - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) + - [Git Configurations](#git-configurations) + - [Aliases](#aliases) + - [Auto-Correct](#auto-correct) + - [Color](#color) + - [Git Resources](#git-resources) + - [Git Books](#git-books) + +## GitHub +### Ignore Whitespace 在任意diff页面的URL后加上`?w=1`,可以去掉那些只是空白字符的变化,使你能更专注于代码的变化。 @@ -65,7 +65,7 @@ [*详见 GitHub secrets.*](https://github.com/blog/967-github-secrets) -### 调整缩进宽度 +### Adjust Tab Space 在diff或者file页面的URL后面加上`?ts=4`,这样当显示tab字符的长度时就会是4个空格的长度,不再是默认的8个空格。`ts`后面的数字还可以根据你个人的偏好进行修改。不过,这个小诀窍在Gists页面和raw file页面不起作用。 下面是我们在Go语言的source file页面URL后加`?ts=4`[前](https://github.com/pengwynn/flint/blob/master/flint/flint.go)的例子: @@ -76,7 +76,7 @@ ![After, tab space example](http://i.imgur.com/70FL4H9.png) -### 查看某个用户的提交历史 +### Commit History by Author 查看某个用户的所有提交历史,只需在commits页面URL后加上`?author=username`。 ``` @@ -87,7 +87,7 @@ https://github.com/rails/rails/commits/master?author=dhh [*深入了解提交视图之间的区别*](https://help.github.com/articles/differences-between-commit-views) -### 克隆仓库 +### Cloning Repository 当我们克隆某一资源时,可以不要那个`.git`后缀。 ```bash @@ -96,7 +96,7 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone) -### 比较分支 +### Comparing Branches 如果我们想要比较两个分支,可以像下面一样修改URL: @@ -129,7 +129,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master [*了解更多关于比较跨时间段的提交记录.*](https://help.github.com/articles/comparing-commits-across-time) -### 派生仓库之间比较分支 +### Compare Branches across Forked Repositories 想要对派生仓库Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现: @@ -182,7 +182,7 @@ Location: https://github.com/... [*进一步了解 Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) -### 快捷键 +### Keyboard Shortcuts 在仓库主页上提供了快捷键方便快速导航。 @@ -198,7 +198,7 @@ Location: https://github.com/... [*进一步了解如何使用 Command Bar.*](https://help.github.com/articles/using-the-command-bar) -### 高亮显示一行或多行代码 +### Line Highlighting in Repositories 在代码文件地址后加上`#L52`或者单击行号52都会将第52行代码高亮显示。 @@ -210,7 +210,7 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Line Highlighting](http://i.imgur.com/8AhjrCz.png) -### 通过提交信息关闭Issue +### Closing Issues via Commit Messages 如果某个提交修复了一个Issue,当提交到master分支时,提交信息里可以使用`fix/fixes/fixed`, `close/closes/closed` 或者 `resolve/resolves/resolved`等关键词,后面再跟上Issue号,这样就会关闭这个Issue。 @@ -224,21 +224,21 @@ $ git commit -m "Fix screwup, fixes #12" [*进一步了解通过提交信息关闭Issue.*](https://help.github.com/articles/closing-issues-via-commit-messages) -### 引用Issue +### Cross-Link Issues 如果你想引用到同一个仓库中的一个Issue,只需使用井号 `#` 加上Issue号,这样就会自动创建到此Issue的链接。 要链接到其他仓库的Issue,就使用`user_name/repo_name#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) -### Pull Requests的CI结果 +### CI Status on Pull Requests 如果配置正确,[Travis CI](https://travis-ci.org/)会为每个你收到的Pull Request执行构建,就像每次提交也会触发构建一样。想了解更多关于Travis CI的信息,请看 [Travis CI入门](http://docs.travis-ci.com/user/getting-started/)。 [![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) [*进一步了解 Commit status API.*](https://github.com/blog/1227-commit-status-api) -### 在Markdown文件中使用语法高亮 +### Syntax Highlighting in Markdown Files 例如,可以像下面这样在你的Markdown文件里为Ruby代码添加语法高亮: ```ruby @@ -261,7 +261,7 @@ Github使用 [Linguist](https://github.com/github/linguist) 做语言识别和 [*进一步了解 GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) -### 使用表情符 +### Emojis 可以在Pull Requests, Issues, 提交消息, Markdown文件里加入表情符。使用方法`:name_of_emoji:` @@ -282,7 +282,7 @@ Github上使用最多的5个表情符号是: 4. :+1: - `:+1:` 5. :clap: - `:clap:` -### 使用图片/GIF动画 +### Images/GIFS 注释和README等文件里也可以使用图片和GIF动画: ``` @@ -293,7 +293,7 @@ Github上使用最多的5个表情符号是: 所有图片都缓存在Gitub,不用担心你的站点不能访问时就看不到图片了。 -#### 在Github Wiki里嵌入图片 +#### Embedding Images in GitHub Wiki 有多种方法可以在Wiki页面里嵌入图片。既可以像上一条里那样使用标准的Markdown语法,也可以像下面这样指定图片的高度或宽度: ```markdown @@ -303,14 +303,14 @@ Github上使用最多的5个表情符号是: ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) -### 快速引用文本 +### Quick Quoting 在注释话题里引用之前某个人所说的,只需选中文本,然后按 `r`键,想要的就会以引用的形式复制到你的输入框里。 ![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) [*进一步了解快速引用.*](https://github.com/blog/1399-quick-quotes) -### 快速选择软件许可 +### Quick Licensing 创建一个仓库时,Github会为你提供一个预置的软件许可列表: ![License](http://i.imgur.com/Chqj4Fg.png) @@ -323,7 +323,7 @@ Github上使用最多的5个表情符号是: [*进一步了解 open source licensing.*](https://help.github.com/articles/open-source-licensing) -### 任务列表 +### Task Lists Issues和Pull requests里可以添加复选框,语法如下(注意空白符): ``` @@ -344,7 +344,7 @@ Issues和Pull requests里可以添加复选框,语法如下(注意空白符 [*进一步了解任务列表.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) -### 相对链接 +### Relative Links Markdown文件里链接到内部内容时推荐使用相对链接。 ```markdown @@ -355,21 +355,21 @@ Markdown文件里链接到内部内容时推荐使用相对链接。 [*进一步了解相对链接.*](https://help.github.com/articles/relative-links-in-readmes) -### GitHub Pages的元数据和插件支持 +### Metadata and Plugin Support for GitHub Pages 在Jekyll页面和文章里,仓库信息可在 `site.github` 命名空间下找到,也可以显示出来,例如,使用 `{{ site.github.project_title }}`显示项目标题。 Jemoji和jekyll-mentions插件为你的Jekyll文章和页面增加了[emoji](#emojis)和[@mentions](https://github.com/blog/821)功能。 [*了解更多 GitHub Pages的元数据和插件支持.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) -### 在文档里查看YAML元数据 +### Viewing YAML Metadata in your Documents 许多博客站点,比如基于[Jekyll](http://jekyllrb.com/)的[GitHub Pages](http://pages.github.com/),都依赖于一些文章头部的YAML格式的元数据。Github会将其渲染成一个水平表格,方便阅读。 ![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) [*进一步了解 在文档里查看YAML元数据.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) -### 渲染表格数据 +### Rendering Tabular Data GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染成表格数据。 @@ -378,7 +378,7 @@ GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染 [*进一步了解渲染表格数据.*](https://github.com/blog/1601-see-your-csvs) ### Diffs -#### 可渲染纯文本Diff +#### Rendered prose Diffs 提交和Pull Requests里包含有Github支持的可渲染文档(比如Markdown)会提供*source* 和 *rendered* 两个视图功能。 @@ -390,21 +390,21 @@ GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染 [*进一步了解渲染纯文本视图Diffs.*](https://github.com/blog/1784-rendered-prose-diffs) -#### 可比较地图 +#### Diffable Maps 当你在GitHub上查看一个包含地理数据的提交或pull request时,Github可以显示数据变动的视觉表示。 [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) [*进一步了解可比较地图.*](https://github.com/blog/1772-diffable-more-customizable-maps) -#### 扩展Diff上下文 [ Expanding Context in Diffs ] +#### Expanding Context in Diffs 你可以通过点击diff边栏里的 *unfold* 按钮来多显示几行上下文。你可以一直点击 *unfold* 按钮直到显示了文件的全部内容。这个功能在所有GitHub产生的diff界面都可以使用。 ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) [*进一步了解扩展Diff上下文.*](https://github.com/blog/1705-expanding-context-in-diffs) -#### Pull Request的Diff或Patch +#### Diff or Patch of Pull Request 在Pull Request的URL后面加上 `.diff` 或 `.patch` 的扩展名就可以得到它的diff或patch文件,例如: ``` @@ -444,7 +444,7 @@ $ hub clone tiimgreen/toc [*查看更多Hub提供的超酷命令.*](https://github.com/github/hub#commands) -### 减少贡献者冲突 +### Decreasing Contributor Friction 假设你想人们使用你的项目并给你的项目做出贡献,你往往需要回答他们常见问题。这个项目是干什么用的?我如何使用它?允许我怎样使用?我如何为项目出力?我怎样配置开发环境?我怎么能保证新功能不会破坏已有的功能? [Friction](https://github.com/rafalchmiel/friction)是一个命令行脚本,用来检查你的项目是否[回答了这些问题](https://github.com/rafalchmiel/friction/wiki)。下面是示例输出: @@ -453,7 +453,7 @@ $ hub clone tiimgreen/toc *Friction 支持 MRI 2.1.0, MRI 2.0.0 和 MRI 1.9.3.* -### 贡献者指南 +### Contributing Guidelines 在你的仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建Issue或Pull Request时会看到这个文件的链接。 @@ -461,7 +461,7 @@ $ hub clone tiimgreen/toc [*进一步了解贡献者指南.*](https://github.com/blog/1184-contributing-guidelines) -### GitHub参考资源 +### GitHub Resources | Title | Link | | ----- | ---- | | GitHub Explore | https://github.com/explore | @@ -470,7 +470,7 @@ $ hub clone tiimgreen/toc | GitHub Training | http://training.github.com/ | | GitHub Developer | https://developer.github.com/ | -#### Github演讲 +#### Github Talks | Title | Link | | ----- | ---- | | How GitHub Uses GitHub to Build GitHub | https://www.youtube.com/watch?v=qyz3jkOBbQY | @@ -479,8 +479,8 @@ $ hub clone tiimgreen/toc | 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篇 -### 上一个分支 +## Git +### Previous Branch 快速检出上一个分支: ```bash @@ -496,7 +496,7 @@ $ git checkout - [*进一步了解 Git 分支.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) -### 去除文件里的空白 +### Stripspace Git Stripspace命令可以: @@ -512,7 +512,7 @@ $ git stripspace < README.md [*进一步了解 Git `stripspace` 命令.*](http://git-scm.com/docs/git-stripspace) -### 检出Pull Requests +### Checking out Pull Requests 如果想检出pull requests到本地,可以先用下面的fetch命令: ```bash @@ -554,7 +554,7 @@ $ git checkout origin/pr/42 [*进一步了解如何检出pull request到本地.*](https://help.github.com/articles/checking-out-pull-requests-locally) -### 空提交 :trollface: +### Empty Commits :trollface: 可以使用`--allow-empty`选项强制创建一个没有任何改动的提交: ```bash @@ -568,7 +568,7 @@ $ git commit -m "Big-ass commit" --allow-empty - 跟使用你仓库的其他人交流。 - 作为仓库的第一次提交,因为第一次提交日后是不能被rebase的: `git commit -m "init repo" --allow-empty`. -### 给Git Status命令加样式 +### Styled Git Status 在命令行输入如下命令: ```bash @@ -591,7 +591,7 @@ $ git status -sb [*进一步了解 Git `status` 命令.*](http://git-scm.com/docs/git-status) -### 给Git Log命令加样式 +### Styled Git Log 输入如下命令: ```bash @@ -608,7 +608,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s [*进一步了解 Git `log` 命令.*](http://git-scm.com/docs/git-log) -### Git查询 +### Git Query Git查询运行你在之前的所有提交信息里进行搜索,找到其中和搜索条件相匹配的最近的一条。 ```bash @@ -624,7 +624,7 @@ $ git show :/typo * 按 `q` 键退出命令。* -### 已合并的分支 +### Merged Branches 输入命令: ```bash @@ -643,7 +643,7 @@ $ git branch --no-merged [*进一步了解 Git `branch` 命令.*](http://git-scm.com/docs/git-branch) -### 用来浏览本地仓库的web服务器 +### Web Server for Browsing Local Repositories 使用Git的 `instaweb` 可以立即在 `gitweb`中浏览你的工作仓库。这个命令是个简单的脚步,配置了`gitweb`和用来浏览本地仓库的Web服务器。*(译者注:默认需要lighttpd支持)* ```bash @@ -656,10 +656,10 @@ $ git instaweb [*进一步了解 Git `instaweb` 命令.*](http://git-scm.com/docs/git-instaweb) -### Git配置 +### Git Configurations 所有Git配置都保存在你的`.gitconfig` 文件中。 -#### 别名 [ Aliases ] +#### Aliases 别名用来帮助你定义自己的git命令。比如你可以定义 `git a` 来运行 `git add --all`。 要添加一个别名, 一种方法是打开 `~/.gitconfig` 文件并添加如下内容: @@ -705,7 +705,7 @@ $ git config --global alias.ac 'add -A . && commit' | `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` | | `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | -#### 自动纠错 +#### Auto-Correct 如果键入 `git comit` 你会看到如下输出: ```bash @@ -731,7 +731,7 @@ $ git comit -m "Message" # in 0.1 seconds automatically... ``` -#### 颜色 +#### Color 要在你的Git命令输出里加上颜色的话,可以用如下命令: ```bash @@ -740,7 +740,7 @@ $ git config --global color.ui 1 [*进一步了解 Git `config` 命令.*](http://git-scm.com/docs/git-config) -### Git参考资源 +### Git Resources | Title | Link | | ----- | ---- | | Official Git Site | http://git-scm.com/ | @@ -755,7 +755,7 @@ $ git config --global color.ui 1 | Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | | Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | -#### Git书籍 +#### Git Books | Title | Link | | ----- | ---- | | Pragmatic Version Control Using Git | http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git | From 89ab2494976cd979a3016754ff59da0c81d086ed Mon Sep 17 00:00:00 2001 From: waterfox0323 Date: Wed, 30 Apr 2014 10:28:11 +0800 Subject: [PATCH 113/292] fix a mismatched brace --- README.zh-cn.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 554caba..687f6bb 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -131,7 +131,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ### Compare Branches across Forked Repositories -想要对派生仓库Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现: +想要对派生仓库(Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现: ``` https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} @@ -186,10 +186,10 @@ Location: https://github.com/... 在仓库主页上提供了快捷键方便快速导航。 - - 按 `t` 键会打开一个文件浏览器。 Pressing `t` will bring up a file explorer. - - 按 `w` 键会打开分支选择菜单。 Pressing `w` will bring up the branch selector. - - 按 `s` 键会激活顶端的命令栏 (Command Bar)。Pressing `s` will select the Command Bar. - - 按 `l` 键编辑Issue列表页的标签。 Pressing `l` will edit labels on existing Issues. + - 按 `t` 键会打开一个文件浏览器。 + - 按 `w` 键会打开分支选择菜单。 + - 按 `s` 键会激活顶端的命令栏 (Command Bar)。 + - 按 `l` 键编辑Issue列表页的标签。 - **查看文件内容时**(如:`https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`),按 `y` 键将会冻结这个页面,这样就算代码被修改了也不会影响你当前看到的。 按`?`查看当前页面支持的快捷键列表: From f97d740d7e80c18c634f719ed0413845db912f99 Mon Sep 17 00:00:00 2001 From: Jeff Welch Date: Thu, 1 May 2014 19:19:47 -0400 Subject: [PATCH 114/292] Fugbix typo. --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.ja.md b/README.ja.md index df02bdd..0429978 100644 --- a/README.ja.md +++ b/README.ja.md @@ -227,7 +227,7 @@ $ git commit -m "Fix screwup, fixes #12" ### プルリクエストでのCI結果の表示 適切に設定を行えばプルリクエストを受け取るたびに、通常のコミットと同じように[Travis CI](https://travis-ci.org/)がそのプルリクエストをビルドするだろう。どう設定するかは[Travis CI: Getting started](http://docs.travis-ci.com/user/getting-started/)を読むと良い。 -[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) +[![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) [*コミット・ステータスAPIについてもっと詳しく*](https://github.com/blog/1227-commit-status-api) diff --git a/README.ko.md b/README.ko.md index a51ea23..56c0cc1 100644 --- a/README.ko.md +++ b/README.ko.md @@ -244,7 +244,7 @@ $ git commit -m "Fix screwup, fixes #12" 정확히 설정되었다면, 풀 리퀘스트를 받거나 풀 리퀘스트에 새로운 커밋을 할 때 마다, [Travis CI](https://travis-ci.org/)가 풀 리퀘스트를 빌드 할 것입니다. [Travis CI 시작하기](http://docs.travis-ci.com/user/getting-started/)를 좀 더 읽어보세요. -[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) +[![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) [*커밋 상태 API에 대해 좀 더 읽어보세요.*](https://github.com/blog/1227-commit-status-api) diff --git a/README.md b/README.md index c1917a7..544c6f2 100644 --- a/README.md +++ b/README.md @@ -228,7 +228,7 @@ To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e. ### CI Status on Pull Requests 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/). -[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) +[![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) [*Read more about the commit status API.*](https://github.com/blog/1227-commit-status-api) diff --git a/README.zh-cn.md b/README.zh-cn.md index 687f6bb..0ba80c8 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -234,7 +234,7 @@ $ git commit -m "Fix screwup, fixes #12" ### CI Status on Pull Requests 如果配置正确,[Travis CI](https://travis-ci.org/)会为每个你收到的Pull Request执行构建,就像每次提交也会触发构建一样。想了解更多关于Travis CI的信息,请看 [Travis CI入门](http://docs.travis-ci.com/user/getting-started/)。 -[![Travic CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) +[![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) [*进一步了解 Commit status API.*](https://github.com/blog/1227-commit-status-api) From d30475c8fcd8aa1573df32a98ee016d628ae4150 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 4 May 2014 17:07:53 +0800 Subject: [PATCH 115/292] test commit --- README.zh-cn.md | 160 ++++++++++++++++++++++++------------------------ 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 0ba80c8..604a0c9 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -5,45 +5,45 @@ # 目录 - [GitHub](#github) - - [Ignore Whitespace](#ignore-whitespace) - - [Adjust Tab Space](#adjust-tab-space) - - [Commit History by Author](#commit-history-by-author) - - [Cloning a Repository](#cloning-a-repository) - - [Comparing Branches](#comparing-branches) - - [Compare Branches across Forked Repositories](#compare-branches-across-forked-repositories) + - [忽略空白字符变化](#ignore-whitespace) + - [调整Tab字符所代表的空格数](#adjust-tab-space) + - [查看某个用户的Commit历史](#commit-history-by-author) + - [克隆某个仓库](#cloning-a-repository) + - [比较分支](#comparing-branches) + - [比较不同派生库的分支](#compare-branches-across-forked-repositories) - [Gists](#gists) - [Git.io](#gitio) - - [Keyboard Shortcuts](#keyboard-shortcuts) - - [Line Highlighting in Repositories](#line-highlighting-in-repositories) - - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) - - [Cross-Link Issues](#cross-link-issues) - - [CI Status on Pull Requests](#ci-status-on-pull-requests) - - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - - [Emojis](#emojis) - - [Images/GIFs](#imagesgifs) - - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - - [Quick Quoting](#quick-quoting) - - [Quick Licensing](#quick-licensing) - - [Task Lists](#task-lists) - - [Relative Links](#relative-links) - - [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) + - [键盘快捷键](#keyboard-shortcuts) + - [整行高亮](#line-highlighting-in-repositories) + - [用commit信息关闭Issue](#closing-issues-via-commit-messages) + - [链接其他仓库的Issue](#cross-link-issues) + - [设置CI对每条Pull Request都进行构建](#ci-status-on-pull-requests) + - [Markdown文件高亮语法](#syntax-highlighting-in-markdown-files) + - [表情符](#emojis) + - [静态与动态图片](#imagesgifs) + - [在GitHub Wiki中嵌入图片](#embedding-images-in-github-wiki) + - [快速引用](#quick-quoting) + - [快速添加许可证](#quick-licensing) + - [任务列表](#task-lists) + - [相对链接](#relative-links) + - [GitHub Pages的元数据与插件支持](#metadata-and-plugin-support-for-github-pages) + - [查看YAML格式的元数据](#viewing-yaml-metadata-in-your-documents) + - [渲染表格数据](#rendering-tabular-data) - [Diffs](#diffs) - - [Rendered prose Diffs](#rendered-prose-diffs) - - [Diffable Maps](#diffable-maps) - - [Expanding Context in Diffs](#expanding-context-in-diffs) - - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) + - [可渲染文档的Diffs](#rendered-prose-diffs) + - [可变化地图](#diffable-maps) + - [在diff中折叠与扩展代码](#expanding-context-in-diffs) + - [查看Pull Request的diff和patch](#diff-or-patch-of-pull-request) - [Hub](#hub) - - [Decreasing Contributor Friction](#decreasing-contributor-friction) - - [Contributing Guidelines](#contributing-guidelines) - - [GitHub Resources](#github-resources) - - [GitHub Talks](#github-talks) + - [贡献内容的自动检查](#decreasing-contributor-friction) + - [贡献者指南](#contributing-guidelines) + - [GitHub资源](#github-resources) + - [GitHub讨论](#github-talks) - [Git](#git) - - [Previous Branch](#previous-branch) - - [Stripspace](#stripspace) - - [Checking out Pull Requests](#checking-out-pull-requests) - - [Empty Commits :trollface:](#empty-commits-trollface) + - [前一个分支](#previous-branch) + - [Stripspace命令](#stripspace) + - [检出Pull Requests](#checking-out-pull-requests) + - [提交空改动 :trollface:](#empty-commits-trollface) - [Styled Git Status](#styled-git-status) - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) @@ -57,7 +57,7 @@ - [Git Books](#git-books) ## GitHub -### Ignore Whitespace +### 忽略空白字符变化 在任意diff页面的URL后加上`?w=1`,可以去掉那些只是空白字符的变化,使你能更专注于代码的变化。 @@ -65,7 +65,7 @@ [*详见 GitHub secrets.*](https://github.com/blog/967-github-secrets) -### Adjust Tab Space +### 调整Tab字符所代表的空格数 在diff或者file页面的URL后面加上`?ts=4`,这样当显示tab字符的长度时就会是4个空格的长度,不再是默认的8个空格。`ts`后面的数字还可以根据你个人的偏好进行修改。不过,这个小诀窍在Gists页面和raw file页面不起作用。 下面是我们在Go语言的source file页面URL后加`?ts=4`[前](https://github.com/pengwynn/flint/blob/master/flint/flint.go)的例子: @@ -76,7 +76,7 @@ ![After, tab space example](http://i.imgur.com/70FL4H9.png) -### Commit History by Author +### 查看某个用户的Commit历史 查看某个用户的所有提交历史,只需在commits页面URL后加上`?author=username`。 ``` @@ -87,7 +87,7 @@ https://github.com/rails/rails/commits/master?author=dhh [*深入了解提交视图之间的区别*](https://help.github.com/articles/differences-between-commit-views) -### Cloning Repository +### 克隆某个仓库 当我们克隆某一资源时,可以不要那个`.git`后缀。 ```bash @@ -96,7 +96,7 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone) -### Comparing Branches +### 比较分支 如果我们想要比较两个分支,可以像下面一样修改URL: @@ -129,7 +129,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master [*了解更多关于比较跨时间段的提交记录.*](https://help.github.com/articles/comparing-commits-across-time) -### Compare Branches across Forked Repositories +### 比较不同派生库的分支 想要对派生仓库(Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现: @@ -182,7 +182,7 @@ Location: https://github.com/... [*进一步了解 Git.io.*](https://github.com/blog/985-git-io-github-url-shortener) -### Keyboard Shortcuts +### 键盘快捷键 在仓库主页上提供了快捷键方便快速导航。 @@ -198,7 +198,7 @@ Location: https://github.com/... [*进一步了解如何使用 Command Bar.*](https://help.github.com/articles/using-the-command-bar) -### Line Highlighting in Repositories +### 整行高亮 在代码文件地址后加上`#L52`或者单击行号52都会将第52行代码高亮显示。 @@ -208,9 +208,9 @@ Location: https://github.com/... https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 ``` -![Line Highlighting](http://i.imgur.com/8AhjrCz.png) +![整行高亮](http://i.imgur.com/8AhjrCz.png) -### Closing Issues via Commit Messages +### 用commit信息关闭Issue 如果某个提交修复了一个Issue,当提交到master分支时,提交信息里可以使用`fix/fixes/fixed`, `close/closes/closed` 或者 `resolve/resolves/resolved`等关键词,后面再跟上Issue号,这样就会关闭这个Issue。 @@ -224,21 +224,21 @@ $ git commit -m "Fix screwup, fixes #12" [*进一步了解通过提交信息关闭Issue.*](https://help.github.com/articles/closing-issues-via-commit-messages) -### Cross-Link Issues +### 链接其他仓库的Issue 如果你想引用到同一个仓库中的一个Issue,只需使用井号 `#` 加上Issue号,这样就会自动创建到此Issue的链接。 要链接到其他仓库的Issue,就使用`user_name/repo_name#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) -### CI Status on Pull Requests +### 设置CI对每条Pull Request都进行构建 如果配置正确,[Travis CI](https://travis-ci.org/)会为每个你收到的Pull Request执行构建,就像每次提交也会触发构建一样。想了解更多关于Travis CI的信息,请看 [Travis CI入门](http://docs.travis-ci.com/user/getting-started/)。 [![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) [*进一步了解 Commit status API.*](https://github.com/blog/1227-commit-status-api) -### Syntax Highlighting in Markdown Files +### Markdown文件高亮语法 例如,可以像下面这样在你的Markdown文件里为Ruby代码添加语法高亮: ```ruby @@ -261,7 +261,7 @@ Github使用 [Linguist](https://github.com/github/linguist) 做语言识别和 [*进一步了解 GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) -### Emojis +### 表情符 可以在Pull Requests, Issues, 提交消息, Markdown文件里加入表情符。使用方法`:name_of_emoji:` @@ -282,7 +282,7 @@ Github上使用最多的5个表情符号是: 4. :+1: - `:+1:` 5. :clap: - `:clap:` -### Images/GIFS +### 静态与动态图片 注释和README等文件里也可以使用图片和GIF动画: ``` @@ -293,7 +293,7 @@ Github上使用最多的5个表情符号是: 所有图片都缓存在Gitub,不用担心你的站点不能访问时就看不到图片了。 -#### Embedding Images in GitHub Wiki +#### 在GitHub Wiki中嵌入图片 有多种方法可以在Wiki页面里嵌入图片。既可以像上一条里那样使用标准的Markdown语法,也可以像下面这样指定图片的高度或宽度: ```markdown @@ -303,14 +303,14 @@ Github上使用最多的5个表情符号是: ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) -### Quick Quoting +### 快速引用 在注释话题里引用之前某个人所说的,只需选中文本,然后按 `r`键,想要的就会以引用的形式复制到你的输入框里。 ![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) [*进一步了解快速引用.*](https://github.com/blog/1399-quick-quotes) -### Quick Licensing +### 快速添加许可证 创建一个仓库时,Github会为你提供一个预置的软件许可列表: ![License](http://i.imgur.com/Chqj4Fg.png) @@ -323,7 +323,7 @@ Github上使用最多的5个表情符号是: [*进一步了解 open source licensing.*](https://help.github.com/articles/open-source-licensing) -### Task Lists +### 任务列表 Issues和Pull requests里可以添加复选框,语法如下(注意空白符): ``` @@ -344,7 +344,7 @@ Issues和Pull requests里可以添加复选框,语法如下(注意空白符 [*进一步了解任务列表.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) -### Relative Links +### 相对链接 Markdown文件里链接到内部内容时推荐使用相对链接。 ```markdown @@ -355,21 +355,21 @@ Markdown文件里链接到内部内容时推荐使用相对链接。 [*进一步了解相对链接.*](https://help.github.com/articles/relative-links-in-readmes) -### Metadata and Plugin Support for GitHub Pages +### GitHub Pages的元数据与插件支持 在Jekyll页面和文章里,仓库信息可在 `site.github` 命名空间下找到,也可以显示出来,例如,使用 `{{ site.github.project_title }}`显示项目标题。 Jemoji和jekyll-mentions插件为你的Jekyll文章和页面增加了[emoji](#emojis)和[@mentions](https://github.com/blog/821)功能。 [*了解更多 GitHub Pages的元数据和插件支持.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) -### Viewing YAML Metadata in your Documents +### 查看YAML格式的元数据 许多博客站点,比如基于[Jekyll](http://jekyllrb.com/)的[GitHub Pages](http://pages.github.com/),都依赖于一些文章头部的YAML格式的元数据。Github会将其渲染成一个水平表格,方便阅读。 ![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) [*进一步了解 在文档里查看YAML元数据.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) -### Rendering Tabular Data +### 渲染表格数据 GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染成表格数据。 @@ -378,7 +378,7 @@ GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染 [*进一步了解渲染表格数据.*](https://github.com/blog/1601-see-your-csvs) ### Diffs -#### Rendered prose Diffs +#### 可渲染文档的Diffs 提交和Pull Requests里包含有Github支持的可渲染文档(比如Markdown)会提供*source* 和 *rendered* 两个视图功能。 @@ -390,21 +390,21 @@ GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染 [*进一步了解渲染纯文本视图Diffs.*](https://github.com/blog/1784-rendered-prose-diffs) -#### Diffable Maps +#### 可变化地图 当你在GitHub上查看一个包含地理数据的提交或pull request时,Github可以显示数据变动的视觉表示。 [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) [*进一步了解可比较地图.*](https://github.com/blog/1772-diffable-more-customizable-maps) -#### Expanding Context in Diffs +#### 在diff中折叠与扩展代码 你可以通过点击diff边栏里的 *unfold* 按钮来多显示几行上下文。你可以一直点击 *unfold* 按钮直到显示了文件的全部内容。这个功能在所有GitHub产生的diff界面都可以使用。 ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) [*进一步了解扩展Diff上下文.*](https://github.com/blog/1705-expanding-context-in-diffs) -#### Diff or Patch of Pull Request +#### 查看Pull Request的diff和patch 在Pull Request的URL后面加上 `.diff` 或 `.patch` 的扩展名就可以得到它的diff或patch文件,例如: ``` @@ -444,7 +444,7 @@ $ hub clone tiimgreen/toc [*查看更多Hub提供的超酷命令.*](https://github.com/github/hub#commands) -### Decreasing Contributor Friction +### 贡献内容的自动检查 假设你想人们使用你的项目并给你的项目做出贡献,你往往需要回答他们常见问题。这个项目是干什么用的?我如何使用它?允许我怎样使用?我如何为项目出力?我怎样配置开发环境?我怎么能保证新功能不会破坏已有的功能? [Friction](https://github.com/rafalchmiel/friction)是一个命令行脚本,用来检查你的项目是否[回答了这些问题](https://github.com/rafalchmiel/friction/wiki)。下面是示例输出: @@ -453,7 +453,7 @@ $ hub clone tiimgreen/toc *Friction 支持 MRI 2.1.0, MRI 2.0.0 和 MRI 1.9.3.* -### Contributing Guidelines +### 贡献者指南 在你的仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建Issue或Pull Request时会看到这个文件的链接。 @@ -461,7 +461,7 @@ $ hub clone tiimgreen/toc [*进一步了解贡献者指南.*](https://github.com/blog/1184-contributing-guidelines) -### GitHub Resources +### GitHub资源 | Title | Link | | ----- | ---- | | GitHub Explore | https://github.com/explore | @@ -470,7 +470,7 @@ $ hub clone tiimgreen/toc | GitHub Training | http://training.github.com/ | | GitHub Developer | https://developer.github.com/ | -#### Github Talks +#### GitHub讨论 | Title | Link | | ----- | ---- | | How GitHub Uses GitHub to Build GitHub | https://www.youtube.com/watch?v=qyz3jkOBbQY | @@ -480,7 +480,7 @@ $ hub clone tiimgreen/toc | More Git and GitHub Secrets | https://www.youtube.com/watch?v=p50xsL-iVgU | ## Git -### Previous Branch +### 前一个分支 快速检出上一个分支: ```bash @@ -496,7 +496,7 @@ $ git checkout - [*进一步了解 Git 分支.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) -### Stripspace +### Stripspace命令 Git Stripspace命令可以: @@ -512,7 +512,7 @@ $ git stripspace < README.md [*进一步了解 Git `stripspace` 命令.*](http://git-scm.com/docs/git-stripspace) -### Checking out Pull Requests +### 检出Pull Requests 如果想检出pull requests到本地,可以先用下面的fetch命令: ```bash @@ -554,7 +554,7 @@ $ git checkout origin/pr/42 [*进一步了解如何检出pull request到本地.*](https://help.github.com/articles/checking-out-pull-requests-locally) -### Empty Commits :trollface: +### 提交空改动 :trollface: 可以使用`--allow-empty`选项强制创建一个没有任何改动的提交: ```bash @@ -568,7 +568,7 @@ $ git commit -m "Big-ass commit" --allow-empty - 跟使用你仓库的其他人交流。 - 作为仓库的第一次提交,因为第一次提交日后是不能被rebase的: `git commit -m "init repo" --allow-empty`. -### Styled Git Status +### 更直观的Git Status 在命令行输入如下命令: ```bash @@ -591,7 +591,7 @@ $ git status -sb [*进一步了解 Git `status` 命令.*](http://git-scm.com/docs/git-status) -### Styled Git Log +### 更直观的Git Log 输入如下命令: ```bash @@ -608,7 +608,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s [*进一步了解 Git `log` 命令.*](http://git-scm.com/docs/git-log) -### Git Query +### Git查询 Git查询运行你在之前的所有提交信息里进行搜索,找到其中和搜索条件相匹配的最近的一条。 ```bash @@ -624,7 +624,7 @@ $ git show :/typo * 按 `q` 键退出命令。* -### Merged Branches +### 合并分支 输入命令: ```bash @@ -643,7 +643,7 @@ $ git branch --no-merged [*进一步了解 Git `branch` 命令.*](http://git-scm.com/docs/git-branch) -### Web Server for Browsing Local Repositories +### 使用网页查看本地仓库 使用Git的 `instaweb` 可以立即在 `gitweb`中浏览你的工作仓库。这个命令是个简单的脚步,配置了`gitweb`和用来浏览本地仓库的Web服务器。*(译者注:默认需要lighttpd支持)* ```bash @@ -656,10 +656,10 @@ $ git instaweb [*进一步了解 Git `instaweb` 命令.*](http://git-scm.com/docs/git-instaweb) -### Git Configurations +### Git配置 所有Git配置都保存在你的`.gitconfig` 文件中。 -#### Aliases +#### Git命令自定义别名 别名用来帮助你定义自己的git命令。比如你可以定义 `git a` 来运行 `git add --all`。 要添加一个别名, 一种方法是打开 `~/.gitconfig` 文件并添加如下内容: @@ -705,7 +705,7 @@ $ git config --global alias.ac 'add -A . && commit' | `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` | | `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | -#### Auto-Correct +#### 自动更正 如果键入 `git comit` 你会看到如下输出: ```bash @@ -731,7 +731,7 @@ $ git comit -m "Message" # in 0.1 seconds automatically... ``` -#### Color +#### 带颜色输入 要在你的Git命令输出里加上颜色的话,可以用如下命令: ```bash @@ -740,7 +740,7 @@ $ git config --global color.ui 1 [*进一步了解 Git `config` 命令.*](http://git-scm.com/docs/git-config) -### Git Resources +### Git资源 | Title | Link | | ----- | ---- | | Official Git Site | http://git-scm.com/ | @@ -755,7 +755,7 @@ $ git config --global color.ui 1 | Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | | Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | -#### Git Books +#### Git参考书籍 | Title | Link | | ----- | ---- | | Pragmatic Version Control Using Git | http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git | From 39b3c5b37576b7be41276e8a48df43ac7987a523 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 4 May 2014 17:09:00 +0800 Subject: [PATCH 116/292] test commit --- README.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 604a0c9..cd1e092 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -5,7 +5,7 @@ # 目录 - [GitHub](#github) - - [忽略空白字符变化](#ignore-whitespace) + - [忽略空白字符变化](#%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) - [调整Tab字符所代表的空格数](#adjust-tab-space) - [查看某个用户的Commit历史](#commit-history-by-author) - [克隆某个仓库](#cloning-a-repository) From f367519aa56a5fd5ed25b3a94890bcbb2672fa47 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 4 May 2014 17:13:16 +0800 Subject: [PATCH 117/292] Change the table of contents into Chinese MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The link haven’t been modified yet. Coming next. --- README.zh-cn.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index cd1e092..882f89c 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -44,17 +44,17 @@ - [Stripspace命令](#stripspace) - [检出Pull Requests](#checking-out-pull-requests) - [提交空改动 :trollface:](#empty-commits-trollface) - - [Styled Git Status](#styled-git-status) - - [Styled Git Log](#styled-git-log) - - [Git Query](#git-query) - - [Merged Branches](#merged-branches) - - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) - - [Git Configurations](#git-configurations) - - [Aliases](#aliases) - - [Auto-Correct](#auto-correct) - - [Color](#color) - - [Git Resources](#git-resources) - - [Git Books](#git-books) + - [更直观的Git Status](#styled-git-status) + - [更直观的Git Log](#styled-git-log) + - [Git查询](#git-query) + - [合并分支](#merged-branches) + - [使用网页查看本地仓库](#web-server-for-browsing-local-repositories) + - [Git配置](#git-configurations) + - [Git命令自定义别名](#aliases) + - [自动更正](#auto-correct) + - [带颜色输出](#color) + - [Git资源](#git-resources) + - [Git参考书籍](#git-books) ## GitHub ### 忽略空白字符变化 @@ -731,7 +731,7 @@ $ git comit -m "Message" # in 0.1 seconds automatically... ``` -#### 带颜色输入 +#### 带颜色输出 要在你的Git命令输出里加上颜色的话,可以用如下命令: ```bash From 5742802ecf47c22fcb5ab02c2872dfc0cc21c5d3 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 4 May 2014 17:28:14 +0800 Subject: [PATCH 118/292] Change links to the working ones --- README.zh-cn.md | 88 ++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 882f89c..6224d74 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -6,55 +6,55 @@ # 目录 - [GitHub](#github) - [忽略空白字符变化](#%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) - - [调整Tab字符所代表的空格数](#adjust-tab-space) - - [查看某个用户的Commit历史](#commit-history-by-author) - - [克隆某个仓库](#cloning-a-repository) - - [比较分支](#comparing-branches) - - [比较不同派生库的分支](#compare-branches-across-forked-repositories) + - [调整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) + - [比较分支](#%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) - - [键盘快捷键](#keyboard-shortcuts) - - [整行高亮](#line-highlighting-in-repositories) - - [用commit信息关闭Issue](#closing-issues-via-commit-messages) - - [链接其他仓库的Issue](#cross-link-issues) - - [设置CI对每条Pull Request都进行构建](#ci-status-on-pull-requests) - - [Markdown文件高亮语法](#syntax-highlighting-in-markdown-files) - - [表情符](#emojis) - - [静态与动态图片](#imagesgifs) - - [在GitHub Wiki中嵌入图片](#embedding-images-in-github-wiki) - - [快速引用](#quick-quoting) - - [快速添加许可证](#quick-licensing) - - [任务列表](#task-lists) - - [相对链接](#relative-links) - - [GitHub Pages的元数据与插件支持](#metadata-and-plugin-support-for-github-pages) - - [查看YAML格式的元数据](#viewing-yaml-metadata-in-your-documents) - - [渲染表格数据](#rendering-tabular-data) + - [键盘快捷键](#%E9%94%AE%E7%9B%98%E5%BF%AB%E6%8D%B7%E9%94%AE) + - [整行高亮](#%E6%95%B4%E8%A1%8C%E9%AB%98%E4%BA%AE) + - [用commit信息关闭Issue](#%E7%94%A8commit%E4%BF%A1%E6%81%AF%E5%85%B3%E9%97%ADissue) + - [链接其他仓库的Issue](#%E9%93%BE%E6%8E%A5%E5%85%B6%E4%BB%96%E4%BB%93%E5%BA%93%E7%9A%84issue) + - [设置CI对每条Pull Request都进行构建](#%E8%AE%BE%E7%BD%AEci%E5%AF%B9%E6%AF%8F%E6%9D%A1pull-request%E9%83%BD%E8%BF%9B%E8%A1%8C%E6%9E%84%E5%BB%BA) + - [Markdown文件高亮语法](#markdown%E6%96%87%E4%BB%B6%E9%AB%98%E4%BA%AE%E8%AF%AD%E6%B3%95) + - [表情符](#%E8%A1%A8%E6%83%85%E7%AC%A6) + - [静态与动态图片](#%E9%9D%99%E6%80%81%E4%B8%8E%E5%8A%A8%E6%80%81%E5%9B%BE%E7%89%87) + - [在GitHub Wiki中嵌入图片](#%E5%9C%A8github-wiki%E4%B8%AD%E5%B5%8C%E5%85%A5%E5%9B%BE%E7%89%87) + - [快速引用](#%E5%BF%AB%E9%80%9F%E5%BC%95%E7%94%A8) + - [快速添加许可证](#%E5%BF%AB%E9%80%9F%E6%B7%BB%E5%8A%A0%E8%AE%B8%E5%8F%AF%E8%AF%81) + - [任务列表](#%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) + - [相对链接](#%E7%9B%B8%E5%AF%B9%E9%93%BE%E6%8E%A5) + - [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) - [Diffs](#diffs) - - [可渲染文档的Diffs](#rendered-prose-diffs) - - [可变化地图](#diffable-maps) - - [在diff中折叠与扩展代码](#expanding-context-in-diffs) - - [查看Pull Request的diff和patch](#diff-or-patch-of-pull-request) + - [可渲染文档的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) + - [在diff中折叠与扩展代码](#%E5%9C%A8diff%E4%B8%AD%E6%8A%98%E5%8F%A0%E4%B8%8E%E6%89%A9%E5%B1%95%E4%BB%A3%E7%A0%81) + - [查看Pull Request的diff和patch](#%E6%9F%A5%E7%9C%8Bpull-request%E7%9A%84diff%E5%92%8Cpatch) - [Hub](#hub) - - [贡献内容的自动检查](#decreasing-contributor-friction) - - [贡献者指南](#contributing-guidelines) - - [GitHub资源](#github-resources) - - [GitHub讨论](#github-talks) + - [贡献内容的自动检查](#%E8%B4%A1%E7%8C%AE%E5%86%85%E5%AE%B9%E7%9A%84%E8%87%AA%E5%8A%A8%E6%A3%80%E6%9F%A5) + - [贡献者指南](#%E8%B4%A1%E7%8C%AE%E8%80%85%E6%8C%87%E5%8D%97) + - [GitHub资源](#github%E8%B5%84%E6%BA%90) + - [GitHub讨论](#github%E8%AE%A8%E8%AE%BA) - [Git](#git) - - [前一个分支](#previous-branch) - - [Stripspace命令](#stripspace) - - [检出Pull Requests](#checking-out-pull-requests) - - [提交空改动 :trollface:](#empty-commits-trollface) - - [更直观的Git Status](#styled-git-status) - - [更直观的Git Log](#styled-git-log) - - [Git查询](#git-query) - - [合并分支](#merged-branches) - - [使用网页查看本地仓库](#web-server-for-browsing-local-repositories) - - [Git配置](#git-configurations) - - [Git命令自定义别名](#aliases) - - [自动更正](#auto-correct) - - [带颜色输出](#color) - - [Git资源](#git-resources) - - [Git参考书籍](#git-books) + - [前一个分支](#%E5%89%8D%E4%B8%80%E4%B8%AA%E5%88%86%E6%94%AF) + - [Stripspace命令](#stripspace%E5%91%BD%E4%BB%A4) + - [检出Pull Requests](#%E6%A3%80%E5%87%BApull-requests) + - [提交空改动 :trollface:](#%E6%8F%90%E4%BA%A4%E7%A9%BA%E6%94%B9%E5%8A%A8-trollface) + - [更直观的Git Status](#%E6%9B%B4%E7%9B%B4%E8%A7%82%E7%9A%84git-status) + - [更直观的Git Log](#%E6%9B%B4%E7%9B%B4%E8%A7%82%E7%9A%84git-log) + - [Git查询](#git%E6%9F%A5%E8%AF%A2) + - [合并分支](#%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF) + - [使用网页查看本地仓库](#%E4%BD%BF%E7%94%A8%E7%BD%91%E9%A1%B5%E6%9F%A5%E7%9C%8B%E6%9C%AC%E5%9C%B0%E4%BB%93%E5%BA%93) + - [Git配置](#git%E9%85%8D%E7%BD%AE) + - [Git命令自定义别名](#git%E5%91%BD%E4%BB%A4%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%AB%E5%90%8D) + - [自动更正](#%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%AD%A3) + - [带颜色输出](#%E5%B8%A6%E9%A2%9C%E8%89%B2%E8%BE%93%E5%87%BA) + - [Git资源](#git%E8%B5%84%E6%BA%90) + - [Git参考书籍](#git%E5%8F%82%E8%80%83%E4%B9%A6%E7%B1%8D) ## GitHub ### 忽略空白字符变化 From 02b3b71980d7aa209a1e35f51583b435470613f2 Mon Sep 17 00:00:00 2001 From: jKey Lu Date: Mon, 5 May 2014 10:10:38 +0800 Subject: [PATCH 119/292] Add Git alias for logs --- README.ja.md | 1 + README.ko.md | 1 + README.md | 1 + README.zh-cn.md | 1 + 4 files changed, 4 insertions(+) diff --git a/README.ja.md b/README.ja.md index 0429978..419310d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -721,6 +721,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 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`とタイプした場合、以下のような出力を得ることだろう: diff --git a/README.ko.md b/README.ko.md index 56c0cc1..258e06a 100644 --- a/README.ko.md +++ b/README.ko.md @@ -773,6 +773,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 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 --'` | #### Auto-correct diff --git a/README.md b/README.md index 544c6f2..5db25bc 100644 --- a/README.md +++ b/README.md @@ -718,6 +718,7 @@ Some useful aliases include: | `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 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 --'` | #### Auto-Correct If you type `git comit` you will get this: diff --git a/README.zh-cn.md b/README.zh-cn.md index 6224d74..4484cac 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -704,6 +704,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 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` 你会看到如下输出: From 3adc486d074bf4c2a5f313689008d9dc71bf4f4d Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 7 May 2014 16:36:09 +0100 Subject: [PATCH 120/292] Add credit for aliases --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 544c6f2..7d6258d 100644 --- a/README.md +++ b/README.md @@ -719,6 +719,8 @@ Some useful aliases include: | `git branches` | `git branch -a` | `git config --global alias.branches 'branch -a'` | | `git remotes` | `git remote -v` | `git config --global alias.remotes 'remote -v'` | +*Some Aliases are taken from [@mathiasbynens](https://github.com/mathiasbynens) dotfiles: https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* + #### Auto-Correct If you type `git comit` you will get this: From 565cfe7185bb22a2c4de15e865ef49510be2032b Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 7 May 2014 17:00:03 +0100 Subject: [PATCH 121/292] Add shortlink (fixes #47) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7d6258d..9f4f94d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # GitHub Cheat Sheet A collection of cool hidden and not so 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)). +*Shortlink: [`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).* ## Table of Contents From 2e2fabd47fb213b2921d67ffa457d217b60d134b Mon Sep 17 00:00:00 2001 From: Yu Haidong Date: Thu, 8 May 2014 09:13:22 +0800 Subject: [PATCH 122/292] =?UTF-8?q?=E2=80=9C=E4=BD=BF=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E2=80=9D=20->=20=E2=80=9C=E9=80=82=E7=94=A8=E4=BA=8E=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 4484cac..0a16d33 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -319,7 +319,7 @@ Github上使用最多的5个表情符号是: ![License](http://i.imgur.com/fTjQict.png) -这个技巧也使用于 `.gitignore` 文件。 +这个技巧也适用于 `.gitignore` 文件。 [*进一步了解 open source licensing.*](https://help.github.com/articles/open-source-licensing) From eff4ace7ba288d2130b3dc6eaea89a8f1538ab8a Mon Sep 17 00:00:00 2001 From: jKey Lu Date: Thu, 8 May 2014 09:18:48 +0800 Subject: [PATCH 123/292] fix `git lg` alias config command --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.ja.md b/README.ja.md index 419310d..e7d657d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -721,7 +721,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 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 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`とタイプした場合、以下のような出力を得ることだろう: diff --git a/README.ko.md b/README.ko.md index 258e06a..d19eaf1 100644 --- a/README.ko.md +++ b/README.ko.md @@ -773,7 +773,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 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 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 --"` | #### Auto-correct diff --git a/README.md b/README.md index 5db25bc..b365c44 100644 --- a/README.md +++ b/README.md @@ -718,7 +718,7 @@ Some useful aliases include: | `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 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 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 --"` | #### Auto-Correct If you type `git comit` you will get this: diff --git a/README.zh-cn.md b/README.zh-cn.md index 4484cac..9634e39 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -704,7 +704,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 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 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` 你会看到如下输出: From 41b6951076657c3138704d6f664f8378299657c1 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Thu, 8 May 2014 14:49:14 +0300 Subject: [PATCH 124/292] Add tutorial of GitHub branches page Describe how to work with the GitHub branches page: - [x] Basic comparing - [x] *Hidden* - How to change the base branch. Something otherwise available only locally. - [x] Show the merged branches. --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index ba1edce..40a4831 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ 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) - [Gists](#gists) @@ -98,6 +99,34 @@ $ 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 + +If you go to (click the branches link next to commits): + +``` +https://github.com/{user}/{repo}/branches +``` + +You would see a list of all branches which are not merged into the main branch (e.g. `master`). + +You could go to the compare page or delete a branch with a click of a button. + +![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) + +However often you need to compare branches to a branch other than `master` (e.g. `development`). Just append the name of the branch to the URL like so: + +``` +https://github.com/{user}/{repo}/branches/{branch} +``` + +![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) + +If you want to see the merged branches you need to append `?merged=1` to the URL. There is a link of that on top. + +![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) + +This view is very nice if you want to find yout which branches to delete (and delete them right from the page) right on GitHub.com. + ### Comparing Branches To use GitHub to compare branches, change the URL to look like this: From caf8a5f23a186518bbdf4c29474a1dfee90a3286 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Thu, 8 May 2014 14:17:39 +0100 Subject: [PATCH 125/292] Fix heading casing --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 40a4831..4b83468 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ 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) + - [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) @@ -99,7 +99,7 @@ $ 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 +### Compare all Branches to Another Branch If you go to (click the branches link next to commits): From 612c81abef27c1d5671a7e36c2272a7d541dc286 Mon Sep 17 00:00:00 2001 From: Joe Fairburn Date: Thu, 8 May 2014 14:21:06 +0100 Subject: [PATCH 126/292] Fixed typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b83468..d95f6dd 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ If you want to see the merged branches you need to append `?merged=1` to the URL ![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) -This view is very nice if you want to find yout which branches to delete (and delete them right from the page) right on GitHub.com. +This view is very nice if you want to find out which branches to delete (and delete them right from the page) right on GitHub.com. ### Comparing Branches To use GitHub to compare branches, change the URL to look like this: From cb079635e3a441b0fd942721f6afba83853cddd8 Mon Sep 17 00:00:00 2001 From: Joe Fairburn Date: Thu, 8 May 2014 14:33:08 +0100 Subject: [PATCH 127/292] Made cosmetic changes. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d95f6dd..1b82c0f 100644 --- a/README.md +++ b/README.md @@ -101,19 +101,19 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet ### Compare all Branches to Another Branch -If you go to (click the branches link next to commits): +If you go to the repo's [Branches](https://github.com/tiimgreen/github-cheat-sheet/branches) page, next to the Commits button: ``` https://github.com/{user}/{repo}/branches ``` -You would see a list of all branches which are not merged into the main branch (e.g. `master`). +... you would see a list of all branches which are not merged into the main branch. -You could go to the compare page or delete a branch with a click of a button. +From here you can access the compare page or delete a branch with a click of a button. ![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) -However often you need to compare branches to a branch other than `master` (e.g. `development`). Just append the name of the branch to the URL like so: +However, often you need to compare branches to a branch other than `master` (e.g. `development`). To do this, append the URL with the name of the branch like so: ``` https://github.com/{user}/{repo}/branches/{branch} @@ -121,11 +121,11 @@ https://github.com/{user}/{repo}/branches/{branch} ![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) -If you want to see the merged branches you need to append `?merged=1` to the URL. There is a link of that on top. +To see the merged branches, append `?merged=1` to the URL. ![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) -This view is very nice if you want to find out which branches to delete (and delete them right from the page) right on GitHub.com. +This view allows you to delete branches easily from the page, without using the command-line. ### Comparing Branches To use GitHub to compare branches, change the URL to look like this: From f65aea3a275b97e7bf85051e254ee0944826fc9f Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Fri, 9 May 2014 04:22:01 +0900 Subject: [PATCH 128/292] Update Ja translation to 81cd43ba8c --- README.ja.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.ja.md b/README.ja.md index e7d657d..18dde2d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -9,6 +9,7 @@ - [タブ幅の調節](#%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) + - [全ブランチを別のブランチと比較](#%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) @@ -96,6 +97,33 @@ $ 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 +``` + +メイン・ブランチにマージされていないブランチの一覧が表示される。 + +このページからボタンをクリックしてブランチ比較ページへ移動したりブランチを削除することができる。 + +![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) + +しかしながら`master`以外(例えば`development`)のブランチと比較したい場合もあるだろう。その場合、以下のようにURLの最後にそのブランチ名を追加すれば良い: + +``` +https://github.com/{user}/{repo}/branches/{branch} +``` + +![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) + +マージ済みのブランチを表示するには`?merged=1`をURLに追加する。 + +![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) + +このビューでは、コマンドラインを使うことなく簡単にページ上でブランチを削除することができるだろう。 + ### ブランチ同士の比較 GitHubのブランチ比較は以下のようなURLで提供されている: From 01806747a9548ba0957426e23fefafff854c03ed Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Fri, 9 May 2014 11:00:48 +0900 Subject: [PATCH 129/292] Update ko to 80c88eb867 --- README.ko.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.ko.md b/README.ko.md index d19eaf1..dcb5a33 100644 --- a/README.ko.md +++ b/README.ko.md @@ -11,6 +11,7 @@ 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) - [Gists](#gists) @@ -103,6 +104,34 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*깃 `clone` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-clone) +### Compare all Branches to Another Branch + +저장소의 [브랜치](https://github.com/tiimgreen/github-cheat-sheet/branches) 페이지는, 커밋 버튼의 뒤에 있습니다. + +``` +https://github.com/{user}/{repo}/branches +``` + +... 메인 브랜치에 머지되지 않은 모든 브랜치의 리스트를 볼 수 있습니다. + +여기에서 버튼 클릭으로 비교 페이지나 브랜치 삭제를 하실 수 있습니다. + +![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) + +하지만, 보통 `master`보다는 다른브랜치(예를 들어 `development`)를 더 자주 비교 합니다. 이렇게 하려면 URL에 브랜치 이름을 붙여줄 필요가 있습니다. + +``` +https://github.com/{user}/{repo}/branches/{branch} +``` + +![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) + +머지된 브랜치들을 보려면 URL에 `?merged=1`를 붙이세요. + +![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) + +이 것을 확인함으로써 커맨드 라인을 사용하지 않은 페이지에서의 브랜치 삭제가 더 쉬워집니다. + ### Comparing Branches 깃허브에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세요. From f7a020121f9ec1339f1dfb7c33e9c5a2e81507c5 Mon Sep 17 00:00:00 2001 From: jordanmccullough Date: Sat, 17 May 2014 16:20:06 -0600 Subject: [PATCH 130/292] Revise description, examples for Pull Requests --- README.md | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 1b82c0f..a359f71 100644 --- a/README.md +++ b/README.md @@ -557,32 +557,22 @@ $ git stripspace < README.md [*Read more about the Git `stripspace` command.*](http://git-scm.com/docs/git-stripspace) ### Checking out Pull Requests -If you want to check out pull request locally, you can fetch it using that command: -```bash -$ git fetch origin '+refs/pull/*/head:refs/pull/*' -``` +Pull Requests are special branches on the GitHub repository which can be retrieved locally in several ways: -then, checkout Pull Request (i.e. 42) using +Retrieve a specific Pull Request and store it temporarily in `FETCH_HEAD` for quickly `diff`ing or `merge`ing: ```bash -$ git checkout refs/pull/42 +git fetch origin refs/pull/[PR-Number] ``` -Alternatively, you can fetch them as remote branches: +Acquire all Pull Request branches as local remote branches by refspec: ```bash $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' ``` -and checkout as: - -```bash -$ git checkout origin/pr/42 -``` - -and even fetch them automatically, if you add corresponding lines in your .git/config: - +Or setup the remote to fetch Pull Requests automatically by adding these corresponding lines in your repository's `.git/config`: ``` [remote "origin"] @@ -597,6 +587,12 @@ and even fetch them automatically, if you add corresponding lines in your .git/c fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` +For Fork-based Pull Request contributions, it's useful to `checkout` a remote branch representing the Pull Request and create a local branch from it: + +```bash +$ git checkout pr/42 pr-42 +``` + [*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) ### Empty Commits :trollface: From 3420c7f62e857f5b258b1cdc487ad5abf58fc359 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Sun, 18 May 2014 10:28:28 +0900 Subject: [PATCH 131/292] Update Ja translation to d40af7d --- README.ja.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/README.ja.md b/README.ja.md index 18dde2d..85f7290 100644 --- a/README.ja.md +++ b/README.ja.md @@ -557,32 +557,21 @@ $ git stripspace < README.md [*Gitの`stripspace`コマンドについてもっと詳しく*](http://git-scm.com/docs/git-stripspace) ### プルリクエストのチェックアウト -プルリクエストをローカル・リポジトリへチェックアウトするには、まず以下のようにコマンドを実行しその変更を取り込む: +プルリクエストはGitHubのリポジトリでは特別なブランチであり、様々な方法でローカルに取り込むことができる: -```bash -$ git fetch origin '+refs/pull/*/head:refs/pull/*' -``` - -そして、プルリクエストを番号(例: 42)を指定してチェックアウトする: +特定のプルリクエストを取り込み、一時的に`FETCH_HEAD`として保存すると、素早く差分を確認してマージすることが可能だ: ```bash -$ git checkout refs/pull/42 +git fetch origin refs/pull/[PR-Number] ``` -別の方法としては、まずプルリクエストをリモート・ブランチとして取り込み: +参照仕様を使うとすべてのプルリクエストをローカル・ブランチとして取り込むことができる: ```bash $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' ``` -それから番号を指定して取り込むこともできる: - -```bash -$ git checkout origin/pr/42 -``` - -またプルリクエストの取り込みは、.git/configに以下の行を追加すると自動化することができる: - +リポジトリの`.git/config`に以下の行を追加すれば自動的にプルリクエストを落とすようにもできるだろう: ``` [remote "origin"] @@ -597,6 +586,12 @@ $ git checkout origin/pr/42 fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` +フォークされてから送られてきたプルリクエストに対しては、そのプルリクエストを参照するリモート・ブランチから直接ローカル・ブランチとしてチェックアウトすると便利だろう: + +```bash +$ git checkout pr/42 pr-42 +``` + [*プルリクエストのチェックアウトについてもっと詳しく*](https://help.github.com/articles/checking-out-pull-requests-locally) ### 空のコミット :trollface: From 41a2fef3bc2861e9bbea4442c08416ebd7a72bdc Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 18 May 2014 11:42:41 +0800 Subject: [PATCH 132/292] Corresponding translation for Pull Request #56 --- README.zh-cn.md | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index b1e4038..e0c4cd0 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -513,32 +513,21 @@ $ git stripspace < README.md [*进一步了解 Git `stripspace` 命令.*](http://git-scm.com/docs/git-stripspace) ### 检出Pull Requests -如果想检出pull requests到本地,可以先用下面的fetch命令: +Pull Request是一种GitHub上可以通过以下多种方式在本地被检索的特别分支: -```bash -$ git fetch origin '+refs/pull/*/head:refs/pull/*' -``` - -然后用checkout命令检查想要的Pull Request(比如42) +检索某个分支并临时储存在本地的`FETCH_HEAD`中以便快速查看更改(diff)以及合并(merge): ```bash -$ git checkout refs/pull/42 +$ git fetch origin refs/pull/[PR-Number] ``` -你也可以把它们当作远程分支来fetch: +通过refspec获取所有的Pull Request为本地分支: ```bash $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' ``` -然后这样检出: - -```bash -$ git checkout origin/pr/42 -``` - -或者干脆在你的.git/config文件里添加如下内容,这样就可以自动获取它们了。 - +或在仓库的`.git/config`中加入下列设置来自动获取远程仓库中的Pull Request ``` [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* @@ -552,6 +541,12 @@ $ git checkout origin/pr/42 fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` +对基于派生库的Pull Request,可以通过先`checkout`代表此Pull Request的远端分支再由此分支建立一个本地分支: + +```bash +$ git checkout pr/42 pr-42 +``` + [*进一步了解如何检出pull request到本地.*](https://help.github.com/articles/checking-out-pull-requests-locally) ### 提交空改动 :trollface: From 44cee8870a991b628188163ad478aa6f81e71eba Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Sun, 18 May 2014 17:16:05 +0900 Subject: [PATCH 133/292] Translate Checking out Pull Requests (ko) --- README.ko.md | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/README.ko.md b/README.ko.md index dcb5a33..9412104 100644 --- a/README.ko.md +++ b/README.ko.md @@ -2,6 +2,8 @@ A collection of cool hidden and not so 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)). +*Shortlink: [`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).* # 목록 @@ -609,31 +611,25 @@ $ git stripspace < README.md ### Checking out Pull Requests -풀 리퀘스트를 체크아웃하려면, 다음 명령어로 가져올 수 있습니다. - -```bash -$ git fetch origin '+refs/pull/*/head:refs/pull/*' -``` +풀 리퀘스트는 깃허브 저장소에서 사용하는 특별한 브랜치로 여러 방법으로 로컬로 +가져 올수 있습니다. -그리고 다음 명령을 사용해 풀 리퀘스트(예를 들어 42라면)를 체크아웃합니다. +빠르게 `diff`나 `merge`를 하기위해 특정 풀 리퀘스트를 임시로 `FETCH_HEAD`로 +가져오려면 이렇게 합니다. ```bash -$ git checkout refs/pull/42 +$ git fetch origin refs/pull/[PR-Number] ``` -아니면, 리모트 브랜치에서 가져올 수도 있습니다. +모든 풀 리퀘스트 브랜치를 refspec에 의한 로컬 리모트 브랜치로 받을 수도 +있습니다. ```bash $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' ``` -그리고 체크아웃은 이렇게 합니다. - -```bash -$ git checkout origin/pr/42 -``` - -그리고 밑의 줄을 .git/config에 추가하면, 자동으로 가져오게도 할 수 있습니다. +밑의 줄들을 저장소의 `.git/config`에 추가하여, 리모트의 풀 리퀘스트를 자동으로 +가져오게도 할 수 있습니다. ``` [remote "origin"] @@ -648,6 +644,13 @@ $ git checkout origin/pr/42 fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` +포크 기반의 풀 리퀘스트 기여를 위해, 풀 리퀘스트의 리모트 브랜치를 `checkout`해 +로컬 브랜치를 만드는 것은 유용합니다. + +```bash +$ git checkout pr/42 pr-42 +``` + [*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally) ### Empty Commits :trollface: @@ -804,6 +807,8 @@ $ git config --global alias.ac 'add -A . && commit' | `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 --"` | +*일부 알리아스는 [@mathiasbynens](https://github.com/mathiasbynens)님의 dotfiles에서 가져왔습니다.(https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig)* + #### Auto-correct 현재 `git comit`를 치면 이런 결과를 보실 수 있습니다. From 36a983effa8e2e613cae15d8180caa5ec527950a Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Sun, 18 May 2014 17:16:25 +0900 Subject: [PATCH 134/292] Small style fix --- README.ja.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index 85f7290..e6c1e4c 100644 --- a/README.ja.md +++ b/README.ja.md @@ -562,7 +562,7 @@ $ git stripspace < README.md 特定のプルリクエストを取り込み、一時的に`FETCH_HEAD`として保存すると、素早く差分を確認してマージすることが可能だ: ```bash -git fetch origin refs/pull/[PR-Number] +$ git fetch origin refs/pull/[PR-Number] ``` 参照仕様を使うとすべてのプルリクエストをローカル・ブランチとして取り込むことができる: diff --git a/README.md b/README.md index a359f71..518fed6 100644 --- a/README.md +++ b/README.md @@ -563,7 +563,7 @@ Pull Requests are special branches on the GitHub repository which can be retriev Retrieve a specific Pull Request and store it temporarily in `FETCH_HEAD` for quickly `diff`ing or `merge`ing: ```bash -git fetch origin refs/pull/[PR-Number] +$ git fetch origin refs/pull/[PR-Number] ``` Acquire all Pull Request branches as local remote branches by refspec: From 0c1af467ac55b81cc642f2430c8e62cc58c22e1b Mon Sep 17 00:00:00 2001 From: Alexandre Arpin Date: Sun, 18 May 2014 15:00:10 -0400 Subject: [PATCH 135/292] Updated Task List section to show Nested Task List --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 518fed6..025f57d 100644 --- a/README.md +++ b/README.md @@ -354,21 +354,27 @@ In Issues and Pull requests check boxes can be added with the following syntax ( ``` - [ ] Be awesome -- [ ] Do stuff +- [ ] Prepare dinner + - [ ] Research recipe + - [ ] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -![Task List](http://i.imgur.com/k2qZi56.png) +![Task List](http://i.imgur.com/jJBXhsY.png) When they are clicked, they will be updated in the pure Markdown: ``` - [x] Be awesome -- [x] Do stuff +- [ ] Prepare dinner + - [x] Research recipe + - [x] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -[*Read more about task lists.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +[*Read more about task lists.*](https://help.github.com/articles/writing-on-github#task-lists) #### Task Lists in Markdown Documents In full Markdown documents **read-only** checklists can now be added using the following syntax: @@ -377,15 +383,19 @@ In full Markdown documents **read-only** checklists can now be added using the f - [ ] Mercury - [x] Venus - [x] Earth + - [x] Moon - [x] Mars -- [ ] Jupiter + - [ ] Deimos + - [ ] Phobos ``` - [ ] Mercury - [x] Venus - [x] Earth + - [x] Moon - [x] Mars -- [ ] Jupiter + - [ ] Deimos + - [ ] Phobos [*Read more about task lists in markdown documents.*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) From 2147427f4b0dafc5e0532e04af3f4648b0bd4177 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Mon, 19 May 2014 14:00:43 +0900 Subject: [PATCH 136/292] Update task list translations(ko, ja, zh-cn) --- README.ja.md | 14 ++++++++++---- README.ko.md | 14 ++++++++++---- README.zh-cn.md | 14 ++++++++++---- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/README.ja.md b/README.ja.md index e6c1e4c..7d756eb 100644 --- a/README.ja.md +++ b/README.ja.md @@ -350,21 +350,27 @@ GitHub上でリポジトリを作成する時、あらかじめ設定されて ``` - [ ] Be awesome -- [ ] Do stuff +- [ ] Prepare dinner + - [ ] Research recipe + - [ ] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -![Task List](http://i.imgur.com/k2qZi56.png) +![Task List](http://i.imgur.com/jJBXhsY.png) これらチェックボックスにチェックが入れられると、同時にMarkdownソースも更新される: ``` - [x] Be awesome -- [x] Do stuff +- [ ] Prepare dinner + - [x] Research recipe + - [x] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -[*タスク・リストについてもっと詳しく*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +[*タスク・リストについてもっと詳しく*](https://help.github.com/articles/writing-on-github#task-lists) #### Markdownファイルでのタスクリスト 通常のMarkdownファイルでも**読み取り専用**のチェックリストを以下のような記法で追加することができる: diff --git a/README.ko.md b/README.ko.md index 9412104..cdb5839 100644 --- a/README.ko.md +++ b/README.ko.md @@ -382,21 +382,27 @@ puts table.to_s ``` - [ ] Be awesome -- [ ] Do stuff +- [ ] Prepare dinner + - [ ] Research recipe + - [ ] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -![Task List](http://i.imgur.com/k2qZi56.png) +![Task List](http://i.imgur.com/jJBXhsY.png) 체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다. ``` - [x] Be awesome -- [x] Do stuff +- [ ] Prepare dinner + - [x] Research recipe + - [x] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -[*테스크 리스트에 대해 더 읽어 보세요.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +[*테스크 리스트에 대해 더 읽어 보세요.*](https://help.github.com/articles/writing-on-github#task-lists) #### Task Lists in Markdown Documents 이제 마크다운 문서에서 **읽기 전용** 체크리스트를 넣을 수 있습니다. diff --git a/README.zh-cn.md b/README.zh-cn.md index e0c4cd0..18c0d6b 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -328,21 +328,27 @@ Issues和Pull requests里可以添加复选框,语法如下(注意空白符 ``` - [ ] Be awesome -- [ ] Do stuff +- [ ] Prepare dinner + - [ ] Research recipe + - [ ] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -![Task List](http://i.imgur.com/k2qZi56.png) +![Task List](http://i.imgur.com/jJBXhsY.png) 当项目被选中时,它对应的Markdown源码也被更新了: ``` - [x] Be awesome -- [x] Do stuff +- [ ] Prepare dinner + - [x] Research recipe + - [x] Buy ingredients + - [ ] Cook recipe - [ ] Sleep ``` -[*进一步了解任务列表.*](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments) +[*进一步了解任务列表.*](https://help.github.com/articles/writing-on-github#task-lists) ### 相对链接 Markdown文件里链接到内部内容时推荐使用相对链接。 From d61d68fd59ca51ee59909ac02c6fbb1a142ec54f Mon Sep 17 00:00:00 2001 From: Sam J Sharpe Date: Mon, 19 May 2014 13:45:40 +0100 Subject: [PATCH 137/292] Fix the URL for checking out a PR to FETCH_HEAD I'm pretty sure this example if missing `/head` on the end, because when I do this it fails: ``` $ git fetch origin refs/pull/70 fatal: Couldn't find remote ref refs/pull/70 fatal: The remote end hung up unexpectedly ``` Whereas when I do this it works: ``` $ git fetch origin refs/pull/70/head From github.internal:organisation/example-repo * branch refs/pull/70/head -> FETCH_HEAD ``` --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.ja.md b/README.ja.md index 7d756eb..0e72e03 100644 --- a/README.ja.md +++ b/README.ja.md @@ -568,7 +568,7 @@ $ git stripspace < README.md 特定のプルリクエストを取り込み、一時的に`FETCH_HEAD`として保存すると、素早く差分を確認してマージすることが可能だ: ```bash -$ git fetch origin refs/pull/[PR-Number] +$ git fetch origin refs/pull/[PR-Number]/head ``` 参照仕様を使うとすべてのプルリクエストをローカル・ブランチとして取り込むことができる: diff --git a/README.ko.md b/README.ko.md index cdb5839..2342f45 100644 --- a/README.ko.md +++ b/README.ko.md @@ -624,7 +624,7 @@ $ git stripspace < README.md 가져오려면 이렇게 합니다. ```bash -$ git fetch origin refs/pull/[PR-Number] +$ git fetch origin refs/pull/[PR-Number]/head ``` 모든 풀 리퀘스트 브랜치를 refspec에 의한 로컬 리모트 브랜치로 받을 수도 diff --git a/README.md b/README.md index 025f57d..4f1bf1d 100644 --- a/README.md +++ b/README.md @@ -573,7 +573,7 @@ Pull Requests are special branches on the GitHub repository which can be retriev Retrieve a specific Pull Request and store it temporarily in `FETCH_HEAD` for quickly `diff`ing or `merge`ing: ```bash -$ git fetch origin refs/pull/[PR-Number] +$ git fetch origin refs/pull/[PR-Number]/head ``` Acquire all Pull Request branches as local remote branches by refspec: diff --git a/README.zh-cn.md b/README.zh-cn.md index 18c0d6b..91dd69a 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -524,7 +524,7 @@ Pull Request是一种GitHub上可以通过以下多种方式在本地被检索 检索某个分支并临时储存在本地的`FETCH_HEAD`中以便快速查看更改(diff)以及合并(merge): ```bash -$ git fetch origin refs/pull/[PR-Number] +$ git fetch origin refs/pull/[PR-Number]/head ``` 通过refspec获取所有的Pull Request为本地分支: From 49c328ad4fbdefcd9778412f05529fc978dacbc4 Mon Sep 17 00:00:00 2001 From: Mitsuteru Date: Tue, 20 May 2014 21:21:21 +0900 Subject: [PATCH 138/292] =?UTF-8?q?Use=20issue=20in=20Japanese,=20too.=20R?= =?UTF-8?q?arely=20seen=20=E3=82=A4=E3=82=B7=E3=83=A5=E3=83=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.ja.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.ja.md b/README.ja.md index 0e72e03..45c96a4 100644 --- a/README.ja.md +++ b/README.ja.md @@ -16,8 +16,8 @@ - [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) - - [コミットからイシューを閉じる](#%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E3%81%8B%E3%82%89%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%82%92%E9%96%89%E3%81%98%E3%82%8B) - - [イシューの相互リンク](#%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%81%AE%E7%9B%B8%E4%BA%92%E3%83%AA%E3%83%B3%E3%82%AF) + - [コミットからissueを閉じる](#%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88%E3%81%8B%E3%82%89%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%82%92%E9%96%89%E3%81%98%E3%82%8B) + - [issueの相互リンク](#%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%81%AE%E7%9B%B8%E4%BA%92%E3%83%AA%E3%83%B3%E3%82%AF) - [プルリクエストでのCI結果の表示](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%A7%E3%81%AEci%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA) - [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) @@ -212,7 +212,7 @@ Location: https://github.com/... - `t`を押すとファイルの検索インターフェイスが起動する。 - `w`を押すとブランチ選択インターフェイスが起動する。 - `s`を押すとコマンド・バーにフォーカスが当たる。 - - イシュー画面で`l`を押すとラベルの編集インターフェイスが開かれる。 + - issue画面で`l`を押すとラベルの編集インターフェイスが開かれる。 - __ファイルを参照している時__(例: `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`)に`y`を押すと、参照している時の状態で固定されるURLに変更される。つまりそのファイルのコードが後に変化したとしても、そのURLでは今とまったく同じ状態で表示されるということだ。 `?`を押すとそのページで使える全ショートカットが表示されるだろう。 @@ -232,23 +232,23 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Line Highlighting](http://i.imgur.com/8AhjrCz.png) -### コミットからイシューを閉じる -あるコミットでイシューを解決した場合、コミットメッセージで`fix/fixes/fixed`や`close/closes/closed`、`resolve/resolves/resolved`に続けてイシュー番号を指定すると、そのコミットがmasterブランチにpushされると同時に指定イシューが閉じられるだろう。 +### コミットからissueを閉じる +あるコミットでissueを解決した場合、コミットメッセージで`fix/fixes/fixed`や`close/closes/closed`、`resolve/resolves/resolved`に続けてissue番号を指定すると、そのコミットがmasterブランチにpushされると同時に指定issueが閉じられるだろう。 ```bash $ git commit -m "Fix screwup, fixes #12" ``` -こうするとイシュー#12が閉じられ、閉じたイシューにはそのコミットへの参照が自動的に追加される。 +こうするとissue#12が閉じられ、閉じたissueにはそのコミットへの参照が自動的に追加される。 ![Closing Repo](http://i.imgur.com/Uh1gZdx.png) -[*コミット・メッセージからイシューを閉じる方法についてもっと詳しく*](https://help.github.com/articles/closing-issues-via-commit-messages) +[*コミット・メッセージからissueを閉じる方法についてもっと詳しく*](https://help.github.com/articles/closing-issues-via-commit-messages) -### イシューの相互リンク -同じリポジトリの違うイシューへリンクを張り参照させたい場合、`#`に続けてイシュー番号を指定する。そうすると自動的にリンクが作成されるだろう。 +### issueの相互リンク +同じリポジトリの違うissueへリンクを張り参照させたい場合、`#`に続けてissue番号を指定する。そうすると自動的にリンクが作成されるだろう。 -別のリポジトリのイシューの場合は`user_name/repo_name#ISSUE_NUMBER`とすれば良い(例: `tiimgreen/toc#12`)。 +別のリポジトリのissueの場合は`user_name/repo_name#ISSUE_NUMBER`とすれば良い(例: `tiimgreen/toc#12`)。 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) @@ -283,7 +283,7 @@ GitHubでは[Linguist](https://github.com/github/linguist)を使って言語を [*GitHub Flavored Markdownについてもっと詳しく*](https://help.github.com/articles/github-flavored-markdown) ### Emoji -Emojiはプルリクエストやイシュー、READMEなどで`:name_of_emoji:`と書くと利用できる: +Emojiはプルリクエストやissue、READMEなどで`:name_of_emoji:`と書くと利用できる: ``` :smile: @@ -326,7 +326,7 @@ GitHub Wikiで画像を追加する方法がいくつかある。通常のMarkdo ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) ### 素早く引用 -イシューのスレッドで他の人のコメントを引用してコメントしたい場合、引用したい文章を選択した状態で`r`を押すと、ブロック引用の記法を使ってテキストエリアにコピーされる。 +issueのスレッドで他の人のコメントを引用してコメントしたい場合、引用したい文章を選択した状態で`r`を押すと、ブロック引用の記法を使ってテキストエリアにコピーされる。 ![Quick Quote](http://i.imgur.com/TzpMIOA.png) @@ -346,7 +346,7 @@ GitHub上でリポジトリを作成する時、あらかじめ設定されて [*オープンソース・ライセンスについてもっと詳しく*](https://help.github.com/articles/open-source-licensing) ### タスクリスト -イシューやプルリクエストでは以下のように(空白に注意)書くとチェックボックスを作成することができる: +issueやプルリクエストでは以下のように(空白に注意)書くとチェックボックスを作成することができる: ``` - [ ] Be awesome @@ -506,7 +506,7 @@ $ git clone https://github.com/tiimgreen/toc.git [![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) ### 開発参加のガイドライン -リポジトリのルートに`CONTRIBUTING`という名前のファイルを置くと、イシューやプルリクエストを作成しようとした時にそれへのリンクが表示されるようになる。 +リポジトリのルートに`CONTRIBUTING`という名前のファイルを置くと、issueやプルリクエストを作成しようとした時にそれへのリンクが表示されるようになる。 ![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) From c5c61f1f9368055831297312906046b6d693e8b6 Mon Sep 17 00:00:00 2001 From: Mitsuteru Date: Tue, 20 May 2014 21:24:14 +0900 Subject: [PATCH 139/292] =?UTF-8?q?Pull=20request=20is=20more=20popular=20?= =?UTF-8?q?than=20=E3=83=97=E3=83=AB=E3=83=AA=E3=82=AF=E3=82=A8=E3=82=B9?= =?UTF-8?q?=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.ja.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.ja.md b/README.ja.md index 45c96a4..a56baee 100644 --- a/README.ja.md +++ b/README.ja.md @@ -18,7 +18,7 @@ - [コードの指定行の強調](#%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%89%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%82%92%E9%96%89%E3%81%98%E3%82%8B) - [issueの相互リンク](#%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%81%AE%E7%9B%B8%E4%BA%92%E3%83%AA%E3%83%B3%E3%82%AF) - - [プルリクエストでのCI結果の表示](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%A7%E3%81%AEci%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA) + - [pull requestでのCI結果の表示](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%A7%E3%81%AEci%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA) - [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) @@ -35,7 +35,7 @@ - [レンダリング済みの差分](#%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) - [マップ差分の可視化](#%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) - - [プルリクエストの内容をDIFFまたはPATCH形式で取得](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) + - [pull requestの内容をDIFFまたはPATCH形式で取得](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) - [Hub](#hub) - [共同開発者との摩擦の軽減](#%E5%85%B1%E5%90%8C%E9%96%8B%E7%99%BA%E8%80%85%E3%81%A8%E3%81%AE%E6%91%A9%E6%93%A6%E3%81%AE%E8%BB%BD%E6%B8%9B) - [開発参加のガイドライン](#%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) @@ -44,7 +44,7 @@ - [Git](#git) - [直前のブランチ](#%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) - - [プルリクエストのチェックアウト](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%A2%E3%82%A6%E3%83%88) + - [pull requestのチェックアウト](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%A2%E3%82%A6%E3%83%88) - [空のコミット :trollface:](#%E7%A9%BA%E3%81%AE%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88-trollface) - [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) @@ -252,8 +252,8 @@ $ git commit -m "Fix screwup, fixes #12" ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) -### プルリクエストでのCI結果の表示 -適切に設定を行えばプルリクエストを受け取るたびに、通常のコミットと同じように[Travis CI](https://travis-ci.org/)がそのプルリクエストをビルドするだろう。どう設定するかは[Travis CI: Getting started](http://docs.travis-ci.com/user/getting-started/)を読むと良い。 +### 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/)を読むと良い。 [![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) @@ -283,7 +283,7 @@ GitHubでは[Linguist](https://github.com/github/linguist)を使って言語を [*GitHub Flavored Markdownについてもっと詳しく*](https://help.github.com/articles/github-flavored-markdown) ### Emoji -Emojiはプルリクエストやissue、READMEなどで`:name_of_emoji:`と書くと利用できる: +Emojiはpull requestやissue、READMEなどで`:name_of_emoji:`と書くと利用できる: ``` :smile: @@ -346,7 +346,7 @@ GitHub上でリポジトリを作成する時、あらかじめ設定されて [*オープンソース・ライセンスについてもっと詳しく*](https://help.github.com/articles/open-source-licensing) ### タスクリスト -issueやプルリクエストでは以下のように(空白に注意)書くとチェックボックスを作成することができる: +issueやpull requestでは以下のように(空白に注意)書くとチェックボックスを作成することができる: ``` - [ ] Be awesome @@ -426,7 +426,7 @@ GitHubでは`.csv`(カンマ区切り)と`.tsv`(タブ区切り)の形 ### 差分の表示 #### レンダリング済みの差分表示 -コミットやプルリクエストにGitHubでレンダリングされて表示されるもの(例: Markdown)が含まれる場合、その*ソース*と*レンダリング済み*の両方の差分を見ることができる。 +コミットやpull requestにGitHubでレンダリングされて表示されるもの(例: Markdown)が含まれる場合、その*ソース*と*レンダリング済み*の両方の差分を見ることができる。 ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) @@ -437,7 +437,7 @@ GitHubでは`.csv`(カンマ区切り)と`.tsv`(タブ区切り)の形 [*レンダリング済みの差分表示についてもっと詳しく*](https://github.com/blog/1784-rendered-prose-diffs) #### マップ差分の可視化 -コミットやプルリクエストにジオデータの変更が含まれている場合はいつも、GitHubではそのジオデータの変化を可視化してくれるだろう。 +コミットやpull requestにジオデータの変更が含まれている場合はいつも、GitHubではそのジオデータの変化を可視化してくれるだろう。 [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) @@ -450,8 +450,8 @@ GitHubでは`.csv`(カンマ区切り)と`.tsv`(タブ区切り)の形 [*差分表示の前後を表示についてもっと詳しく*](https://github.com/blog/1705-expanding-context-in-diffs) -#### プルリクエストの内容をDIFFまたはPATCH形式で取得 -プルリクエストによる差分はそのURLの末尾に`.diff`または`.patch`を追加すると、それぞれの形式で取得することができる。例えば: +#### pull requestの内容をDIFFまたはPATCH形式で取得 +pull requestによる差分はそのURLの末尾に`.diff`または`.patch`を追加すると、それぞれの形式で取得することができる。例えば: ``` https://github.com/tiimgreen/github-cheat-sheet/pull/15 @@ -506,7 +506,7 @@ $ git clone https://github.com/tiimgreen/toc.git [![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) ### 開発参加のガイドライン -リポジトリのルートに`CONTRIBUTING`という名前のファイルを置くと、issueやプルリクエストを作成しようとした時にそれへのリンクが表示されるようになる。 +リポジトリのルートに`CONTRIBUTING`という名前のファイルを置くと、issueやpull requestを作成しようとした時にそれへのリンクが表示されるようになる。 ![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) @@ -562,22 +562,22 @@ $ git stripspace < README.md [*Gitの`stripspace`コマンドについてもっと詳しく*](http://git-scm.com/docs/git-stripspace) -### プルリクエストのチェックアウト -プルリクエストはGitHubのリポジトリでは特別なブランチであり、様々な方法でローカルに取り込むことができる: +### pull requestのチェックアウト +pull requestはGitHubのリポジトリでは特別なブランチであり、様々な方法でローカルに取り込むことができる: -特定のプルリクエストを取り込み、一時的に`FETCH_HEAD`として保存すると、素早く差分を確認してマージすることが可能だ: +特定の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`に以下の行を追加すれば自動的にプルリクエストを落とすようにもできるだろう: +リポジトリの`.git/config`に以下の行を追加すれば自動的にpull requestを落とすようにもできるだろう: ``` [remote "origin"] @@ -592,13 +592,13 @@ $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` -フォークされてから送られてきたプルリクエストに対しては、そのプルリクエストを参照するリモート・ブランチから直接ローカル・ブランチとしてチェックアウトすると便利だろう: +フォークされてから送られてきたpull requestに対しては、そのpull requestを参照するリモート・ブランチから直接ローカル・ブランチとしてチェックアウトすると便利だろう: ```bash $ git checkout pr/42 pr-42 ``` -[*プルリクエストのチェックアウトについてもっと詳しく*](https://help.github.com/articles/checking-out-pull-requests-locally) +[*pull requestのチェックアウトについてもっと詳しく*](https://help.github.com/articles/checking-out-pull-requests-locally) ### 空のコミット :trollface: `--allow-empty`オプションを付けると、コードの変化がなくてもコミットを作成することができる: From 53e07975bbb534f78fe16d8e113827a484f0ff56 Mon Sep 17 00:00:00 2001 From: mitsuteru sawa Date: Tue, 20 May 2014 21:12:43 +0900 Subject: [PATCH 140/292] Correct some words --- README.ja.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index a56baee..45e3198 100644 --- a/README.ja.md +++ b/README.ja.md @@ -68,7 +68,7 @@ GitHub上で差分ページを表示している時、そのURLに`?w=1`を加 [*GitHubの秘密についてもっと詳しく*](https://github.com/blog/967-github-secrets) ### タブ幅の調節 -差分やファイルを表示している時、URLに`?ts=4`を追加するとタブを空白4つの幅で表示する。デフォルトは8つだ。`ts`に指定した数で表示されるということだ。これはGistやrawファイルを表示している時には効果を発揮しない。 +差分やファイルを表示している時、URLに`?ts=4`を追加するとタブを空白4つの幅で表示する。デフォルトは8つだ。`ts`に指定した数で表示されるということだ。これはGistやrawファイルを表示している時には適用されない。 例えば[Goのソースファイル](https://github.com/pengwynn/flint/blob/master/flint/flint.go)を表示している時、`?ts=4`を追加する前はこのように表示されるが: @@ -110,7 +110,7 @@ https://github.com/{user}/{repo}/branches ![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) -しかしながら`master`以外(例えば`development`)のブランチと比較したい場合もあるだろう。その場合、以下のようにURLの最後にそのブランチ名を追加すれば良い: +しかしながら`master`以外、(例えば`development`)のブランチと比較したい場合もあるだろう。その場合、以下のようにURLの最後にそのブランチ名を追加すれば良い: ``` https://github.com/{user}/{repo}/branches/{branch} From 549aa3e68d4939615c7c14b66dc4197d3f550480 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 28 May 2014 23:21:37 +0800 Subject: [PATCH 141/292] add translation for #50 --- README.zh-cn.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index 91dd69a..ab5da2a 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -9,6 +9,7 @@ - [调整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) - [Gists](#gists) @@ -96,6 +97,33 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone) +###将某个分支与其他所有分支进行对比 + +当你点击某个仓库的分支(Branches)选项卡时 + +``` +https://github.com/{user}/{repo}/branches +``` +你会看到一个包含所有未合并的分支的列表。 + +你可以在这里查看比较(Compare)页面或点击删除某个分支。 + +![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) + +有的时候我们需要将多个分支与一个非主分支(master)进行对比,此时可以通过在URL后加入要比较的分支名来实现: + +``` +https://github.com/{user}/{repo}/branches/{branch} +``` + +![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) + +可以在URL后加上`?merged=1`来查看已经合并了的分支。 + +![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) + +你可以使用这个界面来替代命令行直接删除分支。 + ### 比较分支 如果我们想要比较两个分支,可以像下面一样修改URL: From 8a07df7718bf20d198465b1c114dbbfa56e29f32 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 28 May 2014 23:23:13 +0800 Subject: [PATCH 142/292] fix the link in table of contents --- README.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index ab5da2a..0787bbe 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -9,7 +9,7 @@ - [调整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) + - [将某个分支与其他所有分支进行对比](#%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) From 8e5125605a9abd6d8ea9eccb8e301eb8bb3455e1 Mon Sep 17 00:00:00 2001 From: SangHee Kim Date: Sun, 1 Jun 2014 18:59:02 -0600 Subject: [PATCH 143/292] Fix typo. --- README.ko.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ko.md b/README.ko.md index 2342f45..1bf4d68 100644 --- a/README.ko.md +++ b/README.ko.md @@ -343,7 +343,7 @@ puts table.to_s #### Embedding Images in GitHub Wiki -이미지를 위키 페이지ㅇ넣는 방법은 여럿 있습니다. 위에 보이는 일반 마크다운 문법도 있지만, 이미지에 높이와 넓이를 지정할 수 있는 문법도 있습니다. +이미지를 위키 페이지에넣는 방법은 여럿 있습니다. 위에 보이는 일반 마크다운 문법도 있지만, 이미지에 높이와 넓이를 지정할 수 있는 문법도 있습니다. ```markdown [[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] @@ -425,7 +425,7 @@ puts table.to_s ### Relative Links -상대 경로 링크는 마크다운 파일이 내부 건탠츠로 링크될 때 추천합니다. +상대 경로 링크는 마크다운 파일이 내부 컨텐츠로 링크될 때 추천합니다. ```markdown [Link to a header](#awesome-section) From 8db2c16a4061ae4c09c44da3042fee5e9ede6d60 Mon Sep 17 00:00:00 2001 From: Hariadi Hinta Date: Fri, 6 Jun 2014 12:05:13 +0800 Subject: [PATCH 144/292] Rendering and diffing images --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 4f1bf1d..bece284 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Diffable Maps](#diffable-maps) - [Expanding Context in Diffs](#expanding-context-in-diffs) - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) + - [Rendering and diffing images](#rendering-and-diffing-images) - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) @@ -489,6 +490,13 @@ index 88fcf69..8614873 100644 (...) ``` +#### Rendering and diffing images +GitHub can display several common image formats, including PNG, JPG, GIF, and PSD. In addition, there are several ways to compare differences between versions of those image formats. + +[![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https://github.com/blog/1845-psd-viewing-diffing) + +[*Read more about rendering and diffing images.*](https://help.github.com/articles/rendering-and-diffing-images) + ### Hub [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. From e6e718d21e9f02dcdf55f18a094c2fe8cae395dc Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Fri, 6 Jun 2014 19:19:21 +0900 Subject: [PATCH 145/292] Update Ja translation to 27773ac --- README.ja.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.ja.md b/README.ja.md index 45e3198..1fd77d7 100644 --- a/README.ja.md +++ b/README.ja.md @@ -36,6 +36,7 @@ - [マップ差分の可視化](#%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形式で取得](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) - [共同開発者との摩擦の軽減](#%E5%85%B1%E5%90%8C%E9%96%8B%E7%99%BA%E8%80%85%E3%81%A8%E3%81%AE%E6%91%A9%E6%93%A6%E3%81%AE%E8%BB%BD%E6%B8%9B) - [開発参加のガイドライン](#%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) @@ -480,6 +481,12 @@ index 88fcf69..8614873 100644 (...) ``` +#### 画像の表示とDIFF +GitHubは、PNGやJPG、GIF、PSDといった多くの一般的な画像形式の表示をサポートしている。それに加え、様々な方法でこれら画像形式のバージョンごとの差分を比較することもできる。 + +[![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](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をコマンドラインからとても簡単に扱えるようになる。 From b320e028272956f603df409fb15cd0ac846a0d80 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sat, 7 Jun 2014 16:50:36 +0800 Subject: [PATCH 146/292] update translation for 27773ac --- README.zh-cn.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index 0787bbe..2180cb0 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -35,6 +35,7 @@ - [可变化地图](#%E5%8F%AF%E5%8F%98%E5%8C%96%E5%9C%B0%E5%9B%BE) - [在diff中折叠与扩展代码](#%E5%9C%A8diff%E4%B8%AD%E6%8A%98%E5%8F%A0%E4%B8%8E%E6%89%A9%E5%B1%95%E4%BB%A3%E7%A0%81) - [查看Pull Request的diff和patch](#%E6%9F%A5%E7%9C%8Bpull-request%E7%9A%84diff%E5%92%8Cpatch) + - [渲染图像发生的变动](%E6%B8%B2%E6%9F%93%E5%9B%BE%E5%83%8F%E5%8F%91%E7%94%9F%E7%9A%84%E5%8F%98%E5%8A%A8) - [Hub](#hub) - [贡献内容的自动检查](#%E8%B4%A1%E7%8C%AE%E5%86%85%E5%AE%B9%E7%9A%84%E8%87%AA%E5%8A%A8%E6%A3%80%E6%9F%A5) - [贡献者指南](#%E8%B4%A1%E7%8C%AE%E8%80%85%E6%8C%87%E5%8D%97) @@ -466,6 +467,12 @@ index 88fcf69..8614873 100644 (...) ``` +#### 渲染图像发生的变动 +GitHub可以显示包括PNG、JPG、GIF、PSD在内的多种图片格式并提供了几种方式来比较这些格式的图片文件版本间的不同。 + +[![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https://github.com/blog/1845-psd-viewing-diffing) + +[*查看更多关于渲染图像变动的内容*](https://help.github.com/articles/rendering-and-diffing-images) ### Hub [Hub](https://github.com/github/hub)是一个对Git进行了封装的命令行工具,可以帮助你更方便的使用Github。 From a8f54c5fa97407bb273cf4fde7b660e762077ecc Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sat, 7 Jun 2014 16:55:12 +0800 Subject: [PATCH 147/292] fix link --- README.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 2180cb0..04bc34b 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -35,7 +35,7 @@ - [可变化地图](#%E5%8F%AF%E5%8F%98%E5%8C%96%E5%9C%B0%E5%9B%BE) - [在diff中折叠与扩展代码](#%E5%9C%A8diff%E4%B8%AD%E6%8A%98%E5%8F%A0%E4%B8%8E%E6%89%A9%E5%B1%95%E4%BB%A3%E7%A0%81) - [查看Pull Request的diff和patch](#%E6%9F%A5%E7%9C%8Bpull-request%E7%9A%84diff%E5%92%8Cpatch) - - [渲染图像发生的变动](%E6%B8%B2%E6%9F%93%E5%9B%BE%E5%83%8F%E5%8F%91%E7%94%9F%E7%9A%84%E5%8F%98%E5%8A%A8) + - [渲染图像发生的变动](#%E6%B8%B2%E6%9F%93%E5%9B%BE%E5%83%8F%E5%8F%91%E7%94%9F%E7%9A%84%E5%8F%98%E5%8A%A8) - [Hub](#hub) - [贡献内容的自动检查](#%E8%B4%A1%E7%8C%AE%E5%86%85%E5%AE%B9%E7%9A%84%E8%87%AA%E5%8A%A8%E6%A3%80%E6%9F%A5) - [贡献者指南](#%E8%B4%A1%E7%8C%AE%E8%80%85%E6%8C%87%E5%8D%97) From 373637cf95efd35ae5996136acff1388c65892b7 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 8 Jun 2014 21:46:02 +0800 Subject: [PATCH 148/292] Add Chinese translation for "Task lists in MD" --- README.zh-cn.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index 04bc34b..145149a 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -26,6 +26,7 @@ - [快速引用](#%E5%BF%AB%E9%80%9F%E5%BC%95%E7%94%A8) - [快速添加许可证](#%E5%BF%AB%E9%80%9F%E6%B7%BB%E5%8A%A0%E8%AE%B8%E5%8F%AF%E8%AF%81) - [任务列表](#%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) + - [Markdown文件中的任务列表](#Markdown%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) - [相对链接](#%E7%9B%B8%E5%AF%B9%E9%93%BE%E6%8E%A5) - [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) @@ -379,6 +380,31 @@ Issues和Pull requests里可以添加复选框,语法如下(注意空白符 [*进一步了解任务列表.*](https://help.github.com/articles/writing-on-github#task-lists) +####Markdown文件中的任务列表 + +在完全适配Markdown语法的文件中可以使用以下语法加入一个**只读**的任务列表 + + +``` +- [ ] Mercury +- [x] Venus +- [x] Earth + - [x] Moon +- [x] Mars + - [ ] Deimos + - [ ] Phobos +``` + +- [ ] Mercury +- [x] Venus +- [x] Earth + - [x] Moon +- [x] Mars + - [ ] Deimos + - [ ] Phobos + +[*进一步了解Markdown文件中的任务列表*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) + ### 相对链接 Markdown文件里链接到内部内容时推荐使用相对链接。 From d39f804e1ebc3ec66f1999723da0ce395a8c1fa6 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 8 Jun 2014 21:47:53 +0800 Subject: [PATCH 149/292] Add Chinese translation for "Task lists in MD" --- README.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 145149a..3eb82e1 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -26,7 +26,7 @@ - [快速引用](#%E5%BF%AB%E9%80%9F%E5%BC%95%E7%94%A8) - [快速添加许可证](#%E5%BF%AB%E9%80%9F%E6%B7%BB%E5%8A%A0%E8%AE%B8%E5%8F%AF%E8%AF%81) - [任务列表](#%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) - - [Markdown文件中的任务列表](#Markdown%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) + - [Markdown文件中的任务列表](#markdown%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) - [相对链接](#%E7%9B%B8%E5%AF%B9%E9%93%BE%E6%8E%A5) - [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) From 8e3edec4967db8e5b33e40e43e1de464be13519e Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Mon, 9 Jun 2014 11:25:39 +0900 Subject: [PATCH 150/292] Translate image diff (ko) --- README.ko.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index 1bf4d68..0136126 100644 --- a/README.ko.md +++ b/README.ko.md @@ -40,6 +40,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Diffable Maps](#diffable-maps) - [Expanding Context in Diffs](#expanding-context-in-diffs) - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) + - [Rendering and diffing images](#rendering-and-diffing-images) - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) @@ -524,7 +525,15 @@ index 88fcf69..8614873 100644 (...) ``` -### Hub - Git Wrapper +#### Rendering and diffing images + +깃허브는 PNG, JPG, GIF, PSD를 포함한 여러 일반 적인 이미지 형식을 표시할 수 있습니다. 추가적으로 이미지 형식의 diff를 표시하는 여러 방법을 제공합니다. + +[![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](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)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. From 6e2d0d42d2719b761f6f480108eea235b7194268 Mon Sep 17 00:00:00 2001 From: Thom Parkin Date: Wed, 11 Jun 2014 08:06:56 -0400 Subject: [PATCH 151/292] Added Gist 'commit' syntax Gists are treated just like repositories (they really *are* repositories), so you can push changes back to a Gist from the command line. This means you also can modify and push updates to Gists: --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index bece284..7b2083e 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,14 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) +This means you also can modify and push updates to Gists: + +```bash +$ git commit +$ Username for 'https://gist.github.com': +$ Password for 'https://tiimgreen@gist.github.com': +``` + [*Read more about creating gists.*](https://help.github.com/articles/creating-gists) ### Git.io From 19f7e91731397c364ab6ce22d380f91721d2cce8 Mon Sep 17 00:00:00 2001 From: Thom Parkin Date: Wed, 11 Jun 2014 08:08:47 -0400 Subject: [PATCH 152/292] Added Gist 'push' syntax - needs proper translation Gists are treated just like repositories (they really *are* repositories), so you can push changes back to a Gist from the command line. --- README.zh-cn.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index 3eb82e1..80797f8 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -191,6 +191,15 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) +This means you can also modify and update Gists: + +```bash +$ git commit +$ Username for 'https://gist.github.com': +$ Password for 'https://tiimgreen@gist.github.com': +``` + + [*进一步了解如何创建 gists.*](https://help.github.com/articles/creating-gists) ### Git.io From d0abb00582994bae6d719b71a0190bce214e400d Mon Sep 17 00:00:00 2001 From: Thom Parkin Date: Wed, 11 Jun 2014 08:09:57 -0400 Subject: [PATCH 153/292] Added Gists 'push' syntax - this requires proper translation Gists are treated just like repositories (they really *are* repositories), so you can push changes back to a Gist from the command line. --- README.ko.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.ko.md b/README.ko.md index 0136126..4cc8371 100644 --- a/README.ko.md +++ b/README.ko.md @@ -200,6 +200,14 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) +This means you also can modify and push updates to Gists: + +```bash +$ git commit +$ Username for 'https://gist.github.com': +$ Password for 'https://tiimgreen@gist.github.com': +``` + [*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) ### Git.io From d66293a595a21126c622155daf7123c71bda570d Mon Sep 17 00:00:00 2001 From: Thom Parkin Date: Wed, 11 Jun 2014 08:11:03 -0400 Subject: [PATCH 154/292] Added Gists 'push' syntax - this requires proper translation Gists are treated just like repositories (they really *are* repositories), so you can push changes back to a Gist from the command line. --- README.ja.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.ja.md b/README.ja.md index 1fd77d7..981f553 100644 --- a/README.ja.md +++ b/README.ja.md @@ -186,6 +186,15 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) +This means you also can modify and push updates to Gists: + +```bash +$ git commit +$ Username for 'https://gist.github.com': +$ Password for 'https://tiimgreen@gist.github.com': +``` + + [*Gistの作成についてもっと詳しく*](https://help.github.com/articles/creating-gists) ### Git.io From 80da03bf2924b0be4824046afd567120db47f62f Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 25 Jun 2014 15:36:11 +0800 Subject: [PATCH 155/292] Categorize everything about "branch" --- README.zh-cn.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 3eb82e1..ca03c14 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -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) @@ -99,7 +100,8 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone) -###将某个分支与其他所有分支进行对比 +###分支 +####将某个分支与其他所有分支进行对比 当你点击某个仓库的分支(Branches)选项卡时 @@ -126,7 +128,7 @@ https://github.com/{user}/{repo}/branches/{branch} 你可以使用这个界面来替代命令行直接删除分支。 -### 比较分支 +#### 比较分支 如果我们想要比较两个分支,可以像下面一样修改URL: @@ -159,7 +161,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master [*了解更多关于比较跨时间段的提交记录.*](https://help.github.com/articles/comparing-commits-across-time) -### 比较不同派生库的分支 +#### 比较不同派生库的分支 想要对派生仓库(Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现: From 8935509bea8978e65b646af434e7976ac9423616 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 25 Jun 2014 15:36:56 +0800 Subject: [PATCH 156/292] Add revert pull request function --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bece284..6fbd46f 100644 --- a/README.md +++ b/README.md @@ -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,11 @@ 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. + ### Diffs #### Rendered Prose Diffs Commits and pull requests including rendered documents supported by GitHub (e.g. Markdown) feature *source* and *rendered* views. From 19a339359b4642336ac275b9465b8bffce132762 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 25 Jun 2014 17:09:48 +0800 Subject: [PATCH 157/292] Completed the section of reverting pull request --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6fbd46f..cc088e9 100644 --- a/README.md +++ b/README.md @@ -441,6 +441,10 @@ After a pull request is merged, you may find it does not help anything or it was 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. From 75e51a1af091cef5bc3c4fb7dbaf8aeed31524c0 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 25 Jun 2014 17:09:59 +0800 Subject: [PATCH 158/292] Translated the section of reverting pull request --- README.zh-cn.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index ca03c14..3398f9f 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -32,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) @@ -440,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 From d6b3a7e340c5fc291c8f6db2063ad42a0b874437 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 25 Jun 2014 17:18:42 +0800 Subject: [PATCH 159/292] fixed the table of contents --- README.md | 6 +++--- README.zh-cn.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cc088e9..5768b6f 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Commit History by Author](#commit-history-by-author) - [Cloning a Repository](#cloning-a-repository) - [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) + - [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) diff --git a/README.zh-cn.md b/README.zh-cn.md index 3398f9f..7a20061 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -10,9 +10,9 @@ - [查看某个用户的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%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) + - [将某个分支与其他所有分支进行对比](#%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) From e11c7c4820d594ae2f0c2486cfaed66acc3d3460 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Wed, 25 Jun 2014 20:51:23 +0900 Subject: [PATCH 160/292] Update Ja translation to 2a6b638 --- README.ja.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.ja.md b/README.ja.md index 1fd77d7..3a51b50 100644 --- a/README.ja.md +++ b/README.ja.md @@ -9,9 +9,10 @@ - [タブ幅の調節](#%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) - - [全ブランチを別のブランチと比較](#%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) + - [ブランチ](#%E3%83%96%E3%83%A9%E3%83) + - [全ブランチを別のブランチと比較](#%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) @@ -31,6 +32,7 @@ - [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) + - [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) - [マップ差分の可視化](#%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) @@ -98,7 +100,8 @@ $ 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)ページに行くと: ``` @@ -125,7 +128,7 @@ https://github.com/{user}/{repo}/branches/{branch} このビューでは、コマンドラインを使うことなく簡単にページ上でブランチを削除することができるだろう。 -### ブランチ同士の比較 +#### ブランチ同士の比較 GitHubのブランチ比較は以下のようなURLで提供されている: ``` @@ -156,7 +159,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master [*時間を指定してのブランチ比較についてもっと詳しく*](https://help.github.com/articles/comparing-commits-across-time) -### フォークされたリポジトリ間でのブランチ比較 +#### フォークされたリポジトリ間でのブランチ比較 GitHubでフォークされたリポジトリ同士でブランチを比較する場合、以下のようなURLを変更する: ``` @@ -425,6 +428,15 @@ GitHubでは`.csv`(カンマ区切り)と`.tsv`(タブ区切り)の形 [*表形式のデーター表示についてもっと詳しく*](https://github.com/blog/1601-see-your-csvs) +### pull requestの取り消し +pull requestをマージした後、意味がなかったことがわかったり、そのpull requestをマージしたのは間違いだったことがわかることもあるだろう。 + +その取り消しは、pull requestのページに表示されているマージ・コミットの右端にある**Revert**ボタンをクリックすることにより、そのpull requestで行われた変更を取り消すpull requestを作成することによって行うことができる。 + +![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67) + +[*pull requestの取り消しについてもっと詳しく*](https://github.com/blog/1857-introducing-the-revert-button) + ### 差分の表示 #### レンダリング済みの差分表示 コミットやpull requestにGitHubでレンダリングされて表示されるもの(例: Markdown)が含まれる場合、その*ソース*と*レンダリング済み*の両方の差分を見ることができる。 From 75f179d4b7ccbb69e1a385cd7ba030002e661229 Mon Sep 17 00:00:00 2001 From: cgcgbcbc Date: Mon, 26 May 2014 01:39:37 +0800 Subject: [PATCH 161/292] git fixup and autosquash --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 89a47e8..e497278 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) - [Merged Branches](#merged-branches) + - [Fixup and Autosquash](#fixup-and-autosquash) - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) - [Git Configurations](#git-configurations) - [Aliases](#aliases) @@ -637,6 +638,15 @@ Will give you a list of branches that have not been merged into your current bra [*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch) +### Fixup and Autosquash +If there is something wrong with a previous commit (can be one or more from HEAD), for example `abcde`, run the following command after you've amended the problem: +```bash +$ git commit --fixup=abcde +$ git rebase abcde^ --autosquash -i +``` +[*Read more about the Git `commit` command.*](http://git-scm.com/docs/git-commit) +[*Read more about the Git `rebase` command.*](http://git-scm.com/docs/git-rebase) + ### Web Server for Browsing Local Repositories Use the Git `instaweb` command to instantly browse your working repository in `gitweb`. This command is a simple script to set up `gitweb` and a web server for browsing the local repository. From 488cbab45ec9c1075b2edacd44e57da980622d88 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Thu, 26 Jun 2014 19:48:00 +0900 Subject: [PATCH 162/292] Update Ja translation to 0bd08f7 --- README.ja.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.ja.md b/README.ja.md index 46f3aa2..f41d920 100644 --- a/README.ja.md +++ b/README.ja.md @@ -53,6 +53,7 @@ - [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) - [マージ済みブランチ](#%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) @@ -717,6 +718,17 @@ $ 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`とウェブサーバーをセットアップしてローカル・リポジトリをブラウザーで開けるようにする簡単なスクリプトだ。 From 9f2a445ea540b33b7a58262e56f98c8caa347583 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Sun, 6 Jul 2014 16:54:56 +0900 Subject: [PATCH 163/292] Update ko to 776f5d5 --- README.ko.md | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/README.ko.md b/README.ko.md index 4cc8371..f9fc797 100644 --- a/README.ko.md +++ b/README.ko.md @@ -13,9 +13,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) @@ -35,6 +36,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) @@ -55,6 +57,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) - [Merged Branches](#merged-branches) + - [Fixup and Autosquash](#fixup-and-autosquash) - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) - [Git Configurations](#git-configurations) - [Aliases](#aliases) @@ -107,7 +110,8 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*깃 `clone` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-clone) -### Compare all Branches to Another Branch +###Branch +#### Compare all Branches to Another Branch 저장소의 [브랜치](https://github.com/tiimgreen/github-cheat-sheet/branches) 페이지는, 커밋 버튼의 뒤에 있습니다. @@ -135,7 +139,7 @@ https://github.com/{user}/{repo}/branches/{branch} 이 것을 확인함으로써 커맨드 라인을 사용하지 않은 페이지에서의 브랜치 삭제가 더 쉬워집니다. -### Comparing Branches +#### Comparing Branches 깃허브에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세요. @@ -168,7 +172,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master [*시간으로 커밋을 비교하는 법에 대해 더 읽어 보세요.*](https://help.github.com/articles/comparing-commits-across-time) -### Compare branches across forked repositories +#### Compare branches across forked repositories 포크된 저장소간의 브랜치를 비교하려면 URL을 이렇게 변경하세요. @@ -200,7 +204,7 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) -This means you also can modify and push updates to Gists: +이는 Gists에서도 수정하고 업데이트를 부쉬할 수 있다는 의미입니다. ```bash $ git commit @@ -471,8 +475,18 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis [*표 데이타 표시에 대해 더 읽어 보세요.*](https://github.com/blog/1601-see-your-csvs) -### Diffs +###Revert a Pull Request + +풀 리퀘스트가 머지된 후에, 아무 도움이 안되거나 머지가 잘못된 결정이었다는 걸 +눈치 챌 때가 있습니다. + +풀 리퀘스트 페이지의 커밋의 오른 쪽에 있는 **Revert** 버튼을 클릭하면 이 풀리퀘스트를 되돌리는 풀리퀘스트를 만들어 되돌릴 수 있습니다. +![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 산문(prose) 파일이 있는 커밋과 풀 리퀘스트는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. @@ -763,6 +777,18 @@ $ git branch --no-merged [*깃 `branch` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-branch) +### Fixup and Autosquash + +이전(HEAD의 한개 이상 전의) 커밋에 잘못된 부분이 있다면, 예를들어 `abcde`라면, +문제를 수정하고 밑의 커맨드를 입력해 고칠 수 있습니다. + +```bash +$ git commit --fixup=abcde +$ git rebase abcde^ --autosquash -i +``` +[*깃 `commit` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-commit) +[*깃 `rebase` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-rebase) + ### Web Server for Browsing Local Repositories 깃 `instaweb` 커맨드을 사용하면, 즉석에서 `gitweb`안에서 작업중인 저장소를 둘러 볼 From 04307829a644016ea7df246e3eeaaace403438ab Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Sat, 12 Jul 2014 00:42:12 +0100 Subject: [PATCH 164/292] Added how to set up git globally to to fetch pull requests --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 58b6326..251a103 100644 --- a/README.md +++ b/README.md @@ -632,6 +632,22 @@ For Fork-based Pull Request contributions, it's useful to `checkout` a remote br $ git checkout pr/42 pr-42 ``` +Or should you work on more repositories, you can globally configure fetching pull requests in the global git config instead. + +```bash +git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" +``` + +This way, you can use the following short commands in all your repositories: + +```bash +git fetch origin +``` + +```bash +git checkout pr/42 +``` + [*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) ### Empty Commits :trollface: From 29b9f17532a0cae08c8fb9a7f6b19767bee29238 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Sat, 12 Jul 2014 18:31:31 +0900 Subject: [PATCH 165/292] Update Ja translation to 0430782 --- README.ja.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.ja.md b/README.ja.md index f41d920..0fa7a34 100644 --- a/README.ja.md +++ b/README.ja.md @@ -627,6 +627,22 @@ $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' $ 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) ### 空のコミット :trollface: From 69f0c769c57bab1db688bf37cd026cf436ddef9d Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sat, 12 Jul 2014 18:24:55 +0800 Subject: [PATCH 166/292] zh-cn update to 2acb308 --- README.zh-cn.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index c7f55ce..2c72114 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -634,6 +634,23 @@ $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' $ git checkout pr/42 pr-42 ``` +操作多个仓库的时候,可以在Git中设置获取Pull Request的全局选项。 + +``` + git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" +``` + +此时可以在任意仓库中使用以下命令: + +``` + git fetch origin +``` + +``` +git checkout pr/42 +``` + + [*进一步了解如何检出pull request到本地.*](https://help.github.com/articles/checking-out-pull-requests-locally) ### 提交空改动 :trollface: From 0d1d4264a3ab9189de46a1ec9dd88655f4b7b64f Mon Sep 17 00:00:00 2001 From: Kevin Markham Date: Wed, 16 Jul 2014 22:13:15 -0400 Subject: [PATCH 167/292] fix minor typos --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 251a103..0305a3f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Rendering Tabular Data](#rendering-tabular-data) - [Revert a Pull Request](#revert-a-pull-request) - [Diffs](#diffs) - - [Rendered prose Diffs](#rendered-prose-diffs) + - [Rendered Prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) - [Expanding Context in Diffs](#expanding-context-in-diffs) - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) @@ -300,7 +300,7 @@ GitHub uses [Linguist](https://github.com/github/linguist) to perform language d [*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) ### Emojis -Emojis can added to on Pull Requests, Issues, commit messages, Markdown files, etc. using `:name_of_emoji:`: +Emojis can be added to Pull Requests, Issues, commit messages, Markdown files, etc. using `:name_of_emoji:`: ``` :smile: @@ -350,7 +350,7 @@ When on a comment thread and you want to quote something someone previously said [*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) ### Quick Licensing -When creating a repository GitHub gives you the options of adding in a pre-made license: +When creating a repository, GitHub gives you the option of adding in a pre-made license: ![License](http://i.imgur.com/Chqj4Fg.png) @@ -452,11 +452,11 @@ You can revert it by clicking the **Revert** button on the right side of a commi ![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67) -[*Read more about Revert pull request](https://github.com/blog/1857-introducing-the-revert-button) +[*Read more about reverting pull requests*](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. +Commits and pull requests, including rendered documents supported by GitHub (e.g. Markdown), feature *source* and *rendered* views. ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) @@ -551,7 +551,7 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y | 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 Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | #### GitHub Talks @@ -859,7 +859,7 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| Git for Designers | http://hoth.entp.com/output/git_for_designers.html | | 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 | From ef49459546b2f5b3ff647046855f995186ec7f8b Mon Sep 17 00:00:00 2001 From: Tim Green Date: Tue, 22 Jul 2014 15:59:13 +0100 Subject: [PATCH 168/292] Locking Conversations --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 0305a3f..3cf85c8 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Line Highlighting in Repositories](#line-highlighting-in-repositories) - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) - [Cross-Link Issues](#cross-link-issues) + - [Locking Conversations](#locking-conversations) - [CI Status on Pull Requests](#ci-status-on-pull-requests) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Emojis](#emojis) @@ -269,6 +270,18 @@ To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e. ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) +### Locking Conversations +Pull Requests and Issues can now be locked by owners or collaborators of the repo. + +![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) + +This means that users who are not collaborators on the proejct will no longer be able to comment. + +![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) + +[*Read more about locking conversations.*](https://github.com/blog/1847-locking-conversations) + + ### CI Status on Pull Requests 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/). From 74019eb1014c72e24ff5ae44034eafc7d65ad192 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Tue, 22 Jul 2014 16:04:48 +0100 Subject: [PATCH 169/292] Octicons --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3cf85c8..4407974 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) + - [Octicons](#octicons) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [Git](#git) @@ -558,6 +559,12 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y [*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) +### Octicons +GitHubs icons (Octicons) have now been open sourced. + +[*Read more about GitHub's Octicons*](https://octicons.github.com) + + ### GitHub Resources | Title | Link | | ----- | ---- | From 63cbfb92771f68b4dfe30cbe45bf14fd05768f38 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Tue, 22 Jul 2014 16:05:34 +0100 Subject: [PATCH 170/292] Add image to Octicons --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4407974..7ccd3aa 100644 --- a/README.md +++ b/README.md @@ -562,6 +562,8 @@ Adding a `CONTRIBUTING` file to the root of your repository will add a link to y ### Octicons GitHubs icons (Octicons) have now been open sourced. +![Octicons](https://og.github.com/octicons/octicons@1200x630.png) + [*Read more about GitHub's Octicons*](https://octicons.github.com) From da2235d0ed6a12d13e25e91767cb00dac28e8a3f Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Wed, 23 Jul 2014 08:43:19 +0900 Subject: [PATCH 171/292] Update Ja translation to 63cbfb9 --- README.ja.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.ja.md b/README.ja.md index 0fa7a34..4709784 100644 --- a/README.ja.md +++ b/README.ja.md @@ -19,6 +19,7 @@ - [コードの指定行の強調](#%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%89%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%82%92%E9%96%89%E3%81%98%E3%82%8B) - [issueの相互リンク](#%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%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結果の表示](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%A7%E3%81%AEci%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA) - [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) @@ -42,6 +43,7 @@ - [Hub](#hub) - [共同開発者との摩擦の軽減](#%E5%85%B1%E5%90%8C%E9%96%8B%E7%99%BA%E8%80%85%E3%81%A8%E3%81%AE%E6%91%A9%E6%93%A6%E3%81%AE%E8%BB%BD%E6%B8%9B) - [開発参加のガイドライン](#%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) @@ -266,6 +268,17 @@ $ git commit -m "Fix screwup, fixes #12" ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) +### コメントのロック +リポジトリのオーナーや共同開発者ならば、pull requestやissueへのコメントをロックできるようになった。 + +![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) + +つまりそのプロジェクトの共同開発者ではユーザーはコメントをすることができないということだ。 + +![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) + +[*コメントのロックについてもっと詳しく*](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/)を読むと良い。 @@ -541,6 +554,13 @@ $ git clone https://github.com/tiimgreen/toc.git [*開発参加のガイドラインについてもっと詳しく*](https://github.com/blog/1184-contributing-guidelines) +### Octicons +GitHubで使われているアイコン(Octicons)はオープンソース化された。 + +![Octicons](https://og.github.com/octicons/octicons@1200x630.png) + +[*GitHubのOcticonsについてもっと詳しく*](https://octicons.github.com) + ### GitHub Resources | Title | Link | | ----- | ---- | From 1eafd88efda6cf38a9610ba421ac2ba946f67b70 Mon Sep 17 00:00:00 2001 From: ChelseaStats Date: Wed, 23 Jul 2014 10:41:09 +0100 Subject: [PATCH 172/292] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ccd3aa..9eea085 100644 --- a/README.md +++ b/README.md @@ -891,7 +891,7 @@ $ git config --global color.ui 1 | ----- | ---- | | 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 Peepcode | http://peepcode.com/products/git-internals-pdf | +| 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 | From aa8d100c61fd0eaed81b23ce402a8655aa475469 Mon Sep 17 00:00:00 2001 From: Doc gWorldz Date: Fri, 25 Jul 2014 16:13:25 -0400 Subject: [PATCH 173/292] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 9eea085..668cc79 100644 --- a/README.md +++ b/README.md @@ -356,6 +356,13 @@ Which produces: ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) +#### Using Raw GitHub Images +Raw images from the repo can be used by calling them directly.: + +``` +![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +``` + ### Quick Quoting When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. From b957df8dc9b6ee84f4dfb0b6dd9cd621ea924162 Mon Sep 17 00:00:00 2001 From: Doc gWorldz Date: Fri, 25 Jul 2014 16:15:53 -0400 Subject: [PATCH 174/292] Update README.md --- README.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 668cc79..8a4ff54 100644 --- a/README.md +++ b/README.md @@ -341,6 +341,12 @@ Images and GIFs can be added to comments, READMEs etc.: ![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` +Raw images from the repo can be used by calling them directly.: + +``` +![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +``` + ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) All images are cached on GitHub, so if your host goes down, the image will remain available. @@ -356,13 +362,6 @@ Which produces: ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) -#### Using Raw GitHub Images -Raw images from the repo can be used by calling them directly.: - -``` -![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) -``` - ### Quick Quoting When on a comment thread and you want to quote something someone previously said, highlight the text and press `r`, this will copy it into your text box in the block-quote format. From 6f5cfaeab1795c0e626f5ba6d72abe02a5cec199 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Fri, 25 Jul 2014 21:29:56 +0100 Subject: [PATCH 175/292] Needs more :trollface: --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8a4ff54..ad67dbf 100644 --- a/README.md +++ b/README.md @@ -692,6 +692,8 @@ Some use-cases for this (that make sense), include: - Communicating with people using your repository. - The first commit of a repo, as the first commit cannot be rebased later: `git commit -m "init repo" --allow-empty`. +![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) + ### Styled Git Status Running: From 3961f0b387449ef58317ec5766e3860a9c61c191 Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Sun, 27 Jul 2014 11:58:22 +0800 Subject: [PATCH 176/292] zh-cn update for 9c1f837 --- README.zh-cn.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.zh-cn.md b/README.zh-cn.md index 2c72114..c2068f7 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -331,6 +331,12 @@ Github上使用最多的5个表情符号是: ![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` +仓库中的原始图片可以被直接调用: + +``` +![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +``` + ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) 所有图片都缓存在Gitub,不用担心你的站点不能访问时就看不到图片了。 From ee657235c5036139a1e284460cfdf0aadd098bb4 Mon Sep 17 00:00:00 2001 From: Shim Tw Date: Sun, 31 Aug 2014 12:21:23 +0900 Subject: [PATCH 177/292] Update to 6c9cf82 --- README.ko.md | 62 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/README.ko.md b/README.ko.md index f9fc797..438163e 100644 --- a/README.ko.md +++ b/README.ko.md @@ -23,6 +23,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Line Highlighting in Repositories](#line-highlighting-in-repositories) - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) - [Cross-Link Issues](#cross-link-issues) + - [Locking Conversations](#locking-conversations) - [CI Status on Pull Requests](#ci-status-on-pull-requests) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Emojis](#emojis) @@ -38,7 +39,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Rendering Tabular Data](#rendering-tabular-data) - [Revert a Pull Request](#revert-a-pull-request) - [Diffs](#diffs) - - [Rendered prose Diffs](#rendered-prose-diffs) + - [Rendered Prose Diffs](#rendered-prose-diffs) - [Diffable Maps](#diffable-maps) - [Expanding Context in Diffs](#expanding-context-in-diffs) - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) @@ -46,6 +47,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Hub](#hub) - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) + - [Octicons](#octicons) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [Git](#git) @@ -284,6 +286,18 @@ $ git commit -m "Fix screwup, fixes #12" ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) +### Locking Conversations + +풀 리퀘스트와 이슈는 레포지터리의 주인이나 협업자에 의해 잠글 수 있습니다. + +![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) + +이는 프로젝트의 협업자가 아닌 사람은 더이상 커맨트를 달 수 없게된다는 말입니다. + +![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) + +[*대화 잠그기에 대해 더 읽어 보세요.*](https://github.com/blog/1847-locking-conversations) + ### CI Status on Pull Requests 정확히 설정되었다면, 풀 리퀘스트를 받거나 풀 리퀘스트에 새로운 커밋을 할 때 마다, [Travis CI](https://travis-ci.org/)가 풀 리퀘스트를 빌드 할 것입니다. [Travis CI 시작하기](http://docs.travis-ci.com/user/getting-started/)를 좀 더 읽어보세요. @@ -318,7 +332,7 @@ puts table.to_s ### Emojis -에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등등에서 `:에모지의_이름:`으로 만들 수 있습니다. +에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등에 `:에모지의_이름:`으로 넣을 수 있습니다. ``` :smile: @@ -350,6 +364,12 @@ puts table.to_s ![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` +저장소에 있는 이미지는 직접 불러서 사용할 수 있습니다. + +``` +![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +``` + ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) 모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다. @@ -475,7 +495,7 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis [*표 데이타 표시에 대해 더 읽어 보세요.*](https://github.com/blog/1601-see-your-csvs) -###Revert a Pull Request +### Revert a Pull Request 풀 리퀘스트가 머지된 후에, 아무 도움이 안되거나 머지가 잘못된 결정이었다는 걸 눈치 챌 때가 있습니다. @@ -484,12 +504,12 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis ![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67) -[*Read more about Revert pull request](https://github.com/blog/1857-introducing-the-revert-button) +[*풀 리퀘스트 되돌리기에 대해 더 읽어 보세요.*](https://github.com/blog/1857-introducing-the-revert-button) ### Diffs #### Rendered Prose Diffs -산문(prose) 파일이 있는 커밋과 풀 리퀘스트는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. +GitHub에서 지원하는 산문(prose) 파일(예를 들어 Markdown)이 있는 커밋과 풀 리퀘스트에서는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) @@ -585,6 +605,14 @@ $ hub clone tiimgreen/toc [*기여하기에 대해 더 읽어 보세요.*](https://github.com/blog/1184-contributing-guidelines) +### Octicons + +깃허브 아이콘(옥티콘)이 이제 오픈소스가 되었습니다. + +![Octicons](https://og.github.com/octicons/octicons@1200x630.png) + +[*깃 허브의 옥티콘에 대해 더 읽어보세요.*](https://octicons.github.com) + ### GitHub Resources | Title | Link | @@ -592,7 +620,7 @@ $ hub clone tiimgreen/toc | 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 Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | #### GitHub Talks @@ -688,6 +716,22 @@ $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' $ git checkout pr/42 pr-42 ``` +여러 저장소를 다루어야 한다면, 전역 깃 설정에서 풀 리퀘스트를 받을(fetching) 수 있도록 설정 할 수 도 있습니다. + +```bash +git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" +``` + +이렇게 하면 모든 저장소에서 짧은 명령어를 사용 할 수 있습니다. + +```bash +git fetch origin +``` + +```bash +git checkout pr/42 +``` + [*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally) ### Empty Commits :trollface: @@ -705,6 +749,8 @@ $ git commit -m "Big-ass commit" --allow-empty - 저장소를 사용하는 사람과의 대화 - 나중에 리베이스하지 않을 저장소의 첫 커밋으로 사용 `git commit -m "init repo" --allow-empty`. +![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) + ### Styled Git Status ```bash @@ -907,7 +953,7 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| Git for Designers | http://hoth.entp.com/output/git_for_designers.html | | 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 | @@ -918,7 +964,7 @@ $ git config --global color.ui 1 | ----- | ---- | | 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 Peepcode | http://peepcode.com/products/git-internals-pdf | +| 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 | From abdffef5cb35eeed08b0a3db2cde8b418ebc2c51 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Sun, 31 Aug 2014 14:39:50 +0900 Subject: [PATCH 178/292] Update Ja translation to 6f5cfae --- README.ja.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index 4709784..53c3215 100644 --- a/README.ja.md +++ b/README.ja.md @@ -337,6 +337,12 @@ GitHubで使われているEmojiのトップ5は以下の通りだ: ![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` +リポジトリにある画像も直接参照することが出来る: + +``` +![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +``` + ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) あらゆる画像はGitHubでキャッシュされるので、画像のホスティング先が落ちていたとしても変わらず表示されるだろう。 @@ -679,6 +685,8 @@ $ git commit -m "Big-ass commit" --allow-empty - リポジトリを利用して誰かと連絡を取りたい時 - リポジトリへの最初のコミットをやり直しできるようにしたい時: `git commit -m "init repo" --allow-empty`. +![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) + ### Gitステータスのスタイリング 普通に実行すると: @@ -874,16 +882,17 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| Git for Designers | http://hoth.entp.com/output/git_for_designers.html | | 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 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 Peepcode | http://peepcode.com/products/git-internals-pdf | +| 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 | From 4df7b84f38a3fcb9893cdc6e561e5d89f5625b32 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Thu, 1 Jan 2015 12:47:52 +0900 Subject: [PATCH 179/292] Add git cleanup alias --- README.ja.md | 1 + README.ko.md | 1 + README.md | 1 + README.zh-cn.md | 1 + 4 files changed, 4 insertions(+) diff --git a/README.ja.md b/README.ja.md index 4709784..895e58a 100644 --- a/README.ja.md +++ b/README.ja.md @@ -825,6 +825,7 @@ $ git config --global alias.ac 'add -A . && 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 --"` | diff --git a/README.ko.md b/README.ko.md index f9fc797..ab5fc77 100644 --- a/README.ko.md +++ b/README.ko.md @@ -853,6 +853,7 @@ $ git config --global alias.ac 'add -A . && 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 --"` | diff --git a/README.md b/README.md index ad67dbf..6f943d2 100644 --- a/README.md +++ b/README.md @@ -838,6 +838,7 @@ Some useful aliases include: | `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 --"` | diff --git a/README.zh-cn.md b/README.zh-cn.md index c2068f7..780bcdd 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -808,6 +808,7 @@ $ git config --global alias.ac 'add -A . && 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 --"` | From 1abd8af023a2ceb53572070ce08c9e9dbdbc267c Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Sun, 18 Jan 2015 14:01:58 -0800 Subject: [PATCH 180/292] Chrome extension for GH tab size --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad67dbf..c671589 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli [*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) ### Adjust Tab Space -Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views. +Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome extension](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) can automate this. Here is a Go source file [before](https://github.com/pengwynn/flint/blob/master/flint/flint.go) adding `?ts=4`: From 57f1b820c0530ba94127e7307d33601068a1e018 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 18 Jan 2015 22:37:24 +0000 Subject: [PATCH 181/292] Update links/images --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c671589..93aa320 100644 --- a/README.md +++ b/README.md @@ -77,11 +77,11 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli ### Adjust Tab Space Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome extension](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) can automate this. -Here is a Go source file [before](https://github.com/pengwynn/flint/blob/master/flint/flint.go) adding `?ts=4`: +Here is a Go source file before adding `?ts=4`: ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) -...and this is [after](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4) adding `?ts=4`: +...and this is after adding `?ts=4`: ![After, tab space example](http://i.imgur.com/70FL4H9.png) @@ -92,7 +92,7 @@ To view all commits on a repo by author add `?author=username` to the URL. https://github.com/rails/rails/commits/master?author=dhh ``` -![DHH commit history](http://i.imgur.com/mDWwuaY.png) +![DHH commit history](http://i.imgur.com/S7AE29b.png) [*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) @@ -149,7 +149,7 @@ For example: https://github.com/rails/rails/compare/master...4-1-stable ``` -![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) +![Rails branch compare example](http://i.imgur.com/tIRCOsK.png) `{range}` can be changed to things like: From f0cfc202eb7159eb798b128d51c552e74f0be340 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 18 Jan 2015 22:43:05 +0000 Subject: [PATCH 182/292] Remove out-dated feature, fixes #87 --- README.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 93aa320..da0dd5e 100644 --- a/README.md +++ b/README.md @@ -118,21 +118,7 @@ https://github.com/{user}/{repo}/branches From here you can access the compare page or delete a branch with a click of a button. -![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) - -However, often you need to compare branches to a branch other than `master` (e.g. `development`). To do this, append the URL with the name of the branch like so: - -``` -https://github.com/{user}/{repo}/branches/{branch} -``` - -![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) - -To see the merged branches, append `?merged=1` to the URL. - -![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) - -This view allows you to delete branches easily from the page, without using the command-line. +![Compare branches not merged into master in rails/rails repo - https://github.com/rails/rails/branches](http://i.imgur.com/0FEe30z.png) #### Comparing Branches To use GitHub to compare branches, change the URL to look like this: @@ -170,7 +156,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master To use GitHub to compare branches across forked repositories, change the URL to look like this: ``` -https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +https://github.com/{user}/{repo}/compare/{foreign-user}:{branch}...{own-branch} ``` For example: From 3b04f630813f40d5a5c2c4576cf150e1c0423fee Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 18 Jan 2015 22:58:03 +0000 Subject: [PATCH 183/292] Pasting Clipboard Image to Comments, closes #92 --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index da0dd5e..2a64677 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ 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) - - [Branch](#branch) + - [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) @@ -28,6 +28,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Images/GIFs](#imagesgifs) - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - [Quick Quoting](#quick-quoting) + - [Pasting Clipboard Image to Comments](#pasting-clipboard-image-to-comments) - [Quick Licensing](#quick-licensing) - [Task Lists](#task-lists) - [Task Lists in Markdown Documents](#task-lists-in-markdown-documents) @@ -355,6 +356,13 @@ When on a comment thread and you want to quote something someone previously said [*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) +### Pasting Clipboard Image to Comments +After taking a screenshot and adding it to the clipboard (mac: `cmd-ctrl-shift-4`), you can simply paste (`cmd-v / ctrl-v`) the image into the comment section and it will be auto-uploaded to github. + +![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) + +[*Read more about issue attachments.*](https://help.github.com/articles/issue-attachments) + ### Quick Licensing When creating a repository, GitHub gives you the option of adding in a pre-made license: From 704d07fcc6fb72f9835ef935d9a8bcac756bf4cc Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 18 Jan 2015 23:01:31 +0000 Subject: [PATCH 184/292] CONTRIBUTING.md --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a358cf..a4f3c02 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contributing 1. Fork the repository. -2. Add your section - make sure you follow the [styling](#styling) guide. +2. Add your section - make sure you follow the styling guide below. 3. Commit changes. 4. Push your commit. 5. Create a Pull Request. @@ -12,6 +12,6 @@ - Also use `###` for categories (these should group together relevant sections) and `####` for subcategories. - Add a link to your section/category to the contents section (use relative links). - Make sure to include examples wherever possible (preferably GIFs). -- For command-line examples, wrap your commands in a `bash` code block. Ask [@rafalchmiel](https://github.com/rafalchmiel) or [@tiimgreen](https://github.com/tiimgreen) to take a screenshot (so that it is consistent with the rest) of the output if it has color, etc. -- At the end of your section, add a `Read more about...` link. This should directly link to [Git's](http://git-scm.com/docs) or [GitHub's](https://help.github.com/) documentation. +- For command-line examples, wrap your commands in a `bash` code block. +- At the end of your section, add a `Read more about...` link. This should directly link to [Git's](http://git-scm.com/docs), [GitHub's](https://help.github.com), or the relevant documentation. - If your contribution is a translation, add a (relative) link to the README above the [Table of Contents](README.md#table-of-contents). From f122fd1a443684ad6e3f7661561b21e74c7a9223 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 18 Jan 2015 23:05:43 +0000 Subject: [PATCH 185/292] Remove note about Emojis in Markdown files, closes #93 --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 2a64677..d040249 100644 --- a/README.md +++ b/README.md @@ -301,15 +301,7 @@ GitHub uses [Linguist](https://github.com/github/linguist) to perform language d [*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) ### Emojis -Emojis can be added to Pull Requests, Issues, commit messages, Markdown files, etc. using `:name_of_emoji:`: - -``` -:smile: -``` - -Would produce: - -:smile: +Emojis can be added to Pull Requests, Issues, commit messages, etc. using `:name_of_emoji:` 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). From 5e8dd32deea88986ab23d6ab9f8227439c96f996 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 18 Jan 2015 23:32:56 +0000 Subject: [PATCH 186/292] Remove 'friction' section, update images --- README.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index d040249..80d332e 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - [Rendering and diffing images](#rendering-and-diffing-images) - [Hub](#hub) - - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) - [Octicons](#octicons) - [GitHub Resources](#github-resources) @@ -181,7 +180,7 @@ Gists can be treated as a full repository so they can be cloned like any other: $ git clone https://gist.github.com/tiimgreen/10545817 ``` -![Gists](http://i.imgur.com/dULZXXo.png) +![Gists](http://i.imgur.com/BcFzabp.png) This means you also can modify and push updates to Gists: @@ -535,15 +534,6 @@ $ hub clone tiimgreen/toc [*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) -### Decreasing Contributor Friction -If you want people to use and contribute to your project, you need to start by answering their most basic questions. What does the project do? How do I use it? How am I allowed to use it? How do I contribute? How do I get up and running in development? How do I make sure my new features didn't break old functionality? - -[Friction](https://github.com/rafalchmiel/friction) is a command line script that will check your project for common [answers to these questions](https://github.com/rafalchmiel/friction/wiki). This is some example output: - -[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) - -*Friction supports MRI 2.1.0, MRI 2.0.0, and MRI 1.9.3.* - ### Contributing Guidelines Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. @@ -689,7 +679,7 @@ $ git status Produces: -![git status](http://i.imgur.com/o3PEHAA.png) +![git status](http://i.imgur.com/qjPyvXb.png) By adding `-sb`: @@ -699,7 +689,7 @@ $ git status -sb This is produced: -![git status -sb](http://i.imgur.com/xNI1bT0.png) +![git status -sb](http://i.imgur.com/K0OY3nm.png) [*Read more about the Git `status` command.*](http://git-scm.com/docs/git-status) @@ -712,7 +702,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %C Produces: -![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](http://i.imgur.com/EARRQyJ.png) +![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](http://i.imgur.com/58eOtkW.png) Credit to [Palesz](http://stackoverflow.com/users/88355/palesz) From 21b1a7a8b2182799d9bfba051c23382cf84163bf Mon Sep 17 00:00:00 2001 From: Lsong Date: Mon, 19 Jan 2015 16:25:53 +0800 Subject: [PATCH 187/292] fix typo. --- README.zh-cn.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index c2068f7..b291b16 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -352,7 +352,7 @@ Github上使用最多的5个表情符号是: ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) ### 快速引用 -在注释话题里引用之前某个人所说的,只需选中文本,然后按 `r`键,想要的就会以引用的形式复制到你的输入框里。 +在主题评论中引用之前某个人所说的,只需选中文本,然后按 `r`键,想要的就会以引用的形式复制到你的输入框里。 ![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) @@ -690,7 +690,7 @@ $ git status $ git status -sb ``` -这回得到: +这会得到: ![git status -sb](http://i.imgur.com/xNI1bT0.png) @@ -749,7 +749,7 @@ $ git branch --no-merged [*进一步了解 Git `branch` 命令.*](http://git-scm.com/docs/git-branch) ### 使用网页查看本地仓库 -使用Git的 `instaweb` 可以立即在 `gitweb`中浏览你的工作仓库。这个命令是个简单的脚步,配置了`gitweb`和用来浏览本地仓库的Web服务器。*(译者注:默认需要lighttpd支持)* +使用Git的 `instaweb` 可以立即在 `gitweb`中浏览你的工作仓库。这个命令是个简单的脚本,配置了`gitweb`和用来浏览本地仓库的Web服务器。*(译者注:默认需要lighttpd支持)* ```bash $ git instaweb From ec69c8e0d0abb4b5fd87b0090cd02c945354204d Mon Sep 17 00:00:00 2001 From: Lsong Date: Mon, 19 Jan 2015 16:33:23 +0800 Subject: [PATCH 188/292] add translation for Gists section . --- README.zh-cn.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index b291b16..0706519 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -194,7 +194,7 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/dULZXXo.png) -This means you can also modify and update Gists: +这意味着你可以像 Github 仓库一样修改和更新 Gists : ```bash $ git commit @@ -450,7 +450,7 @@ Jemoji和jekyll-mentions插件为你的Jekyll文章和页面增加了[emoji](#em ### 渲染表格数据 -GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染成表格数据。 +GitHub支持将 `.csv` (逗号分隔)和`.tsv` (制表符分隔)格式的文件渲染成表格数据。 ![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) @@ -478,7 +478,7 @@ GitHub支持将 `.csv` (comma分隔)和`.tsv` (tab分隔)格式的文件渲染 [*进一步了解渲染纯文本视图Diffs.*](https://github.com/blog/1784-rendered-prose-diffs) #### 可变化地图 -当你在GitHub上查看一个包含地理数据的提交或pull request时,Github可以显示数据变动的视觉表示。 +当你在GitHub上查看一个包含地理数据的提交或pull request时,Github 将以可视化的方式对比版本之间的差异。 [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) From 94e53212fadb2894b39266d8b9eb5df1758ab6bf Mon Sep 17 00:00:00 2001 From: Glow Chiang Date: Mon, 19 Jan 2015 17:37:21 +0800 Subject: [PATCH 189/292] fix spelling mistake --- README.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index c2068f7..2342cd6 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -339,7 +339,7 @@ Github上使用最多的5个表情符号是: ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) -所有图片都缓存在Gitub,不用担心你的站点不能访问时就看不到图片了。 +所有图片都缓存在Github,不用担心你的站点不能访问时就看不到图片了。 #### 在GitHub Wiki中嵌入图片 有多种方法可以在Wiki页面里嵌入图片。既可以像上一条里那样使用标准的Markdown语法,也可以像下面这样指定图片的高度或宽度: From e18692176d3d2497dfa3365dfa2cd14a53ead364 Mon Sep 17 00:00:00 2001 From: Tim Guo Date: Mon, 19 Jan 2015 15:32:49 -0800 Subject: [PATCH 190/292] Update README.zh-cn.md improve grammar, remove 'friction' section --- README.zh-cn.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 2ca9ffe..33a2ee9 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -40,7 +40,6 @@ - [查看Pull Request的diff和patch](#%E6%9F%A5%E7%9C%8Bpull-request%E7%9A%84diff%E5%92%8Cpatch) - [渲染图像发生的变动](#%E6%B8%B2%E6%9F%93%E5%9B%BE%E5%83%8F%E5%8F%91%E7%94%9F%E7%9A%84%E5%8F%98%E5%8A%A8) - [Hub](#hub) - - [贡献内容的自动检查](#%E8%B4%A1%E7%8C%AE%E5%86%85%E5%AE%B9%E7%9A%84%E8%87%AA%E5%8A%A8%E6%A3%80%E6%9F%A5) - [贡献者指南](#%E8%B4%A1%E7%8C%AE%E8%80%85%E6%8C%87%E5%8D%97) - [GitHub资源](#github%E8%B5%84%E6%BA%90) - [GitHub讨论](#github%E8%AE%A8%E8%AE%BA) @@ -192,7 +191,7 @@ Gists还可以像任何标准仓库一样被克隆。 $ git clone https://gist.github.com/tiimgreen/10545817 ``` -![Gists](http://i.imgur.com/dULZXXo.png) +![Gists](http://i.imgur.com/BcFzabp.png) 这意味着你可以像 Github 仓库一样修改和更新 Gists : @@ -537,15 +536,6 @@ $ hub clone tiimgreen/toc [*查看更多Hub提供的超酷命令.*](https://github.com/github/hub#commands) -### 贡献内容的自动检查 -假设你想人们使用你的项目并给你的项目做出贡献,你往往需要回答他们常见问题。这个项目是干什么用的?我如何使用它?允许我怎样使用?我如何为项目出力?我怎样配置开发环境?我怎么能保证新功能不会破坏已有的功能? - -[Friction](https://github.com/rafalchmiel/friction)是一个命令行脚本,用来检查你的项目是否[回答了这些问题](https://github.com/rafalchmiel/friction/wiki)。下面是示例输出: - -[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) - -*Friction 支持 MRI 2.1.0, MRI 2.0.0 和 MRI 1.9.3.* - ### 贡献者指南 在你的仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建Issue或Pull Request时会看到这个文件的链接。 @@ -668,10 +658,10 @@ $ git commit -m "Big-ass commit" --allow-empty 这样做在如下几种情况下是有意义的: - - 标记一批工作或一个新功能的开始。 - - 记录你对项目进行了跟代码无关的改动。 + - 标记新的工作或一个新功能的开始。 + - 记录对项目的跟代码无关的改动。 - 跟使用你仓库的其他人交流。 - - 作为仓库的第一次提交,因为第一次提交日后是不能被rebase的: `git commit -m "init repo" --allow-empty`. + - 作为仓库的第一次提交,因为第一次提交后不能被rebase: `git commit -m "init repo" --allow-empty`. ### 更直观的Git Status 在命令行输入如下命令: From 6a6e47b859933e53f021f968d59051b0ca3a9fe2 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Tue, 20 Jan 2015 14:58:16 +0900 Subject: [PATCH 191/292] Update korean to 9e4c38b7 --- README.ko.md | 74 ++++++++++++++++------------------------------------ 1 file changed, 23 insertions(+), 51 deletions(-) diff --git a/README.ko.md b/README.ko.md index 438163e..3dcec64 100644 --- a/README.ko.md +++ b/README.ko.md @@ -13,7 +13,7 @@ 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) - - [Branch](#branch) + - [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) @@ -30,6 +30,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Images/GIFs](#imagesgifs) - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - [Quick Quoting](#quick-quoting) + - [Pasting Clipboard Image to Comments](#pasting-clipboard-image-to-comments) - [Quick Licensing](#quick-licensing) - [Task Lists](#task-lists) - [Task Lists in Markdown Documents](#task-lists-in-markdown-documents) @@ -45,7 +46,6 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - [Rendering and diffing images](#rendering-and-diffing-images) - [Hub](#hub) - - [Decreasing Contributor Friction](#decreasing-contributor-friction) - [Contributing Guidelines](#contributing-guidelines) - [Octicons](#octicons) - [GitHub Resources](#github-resources) @@ -80,13 +80,13 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c ### Adjust Tab Space -diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값인 8대신 4공백으로 보여줍니다. `ts`뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw파일에는 적용 되지 않습니다. +diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값인 8대신 4공백으로 보여줍니다. `ts`뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw파일 보기에는 적용 되지 않습니다만, [크롬 익스텐션](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)으로 자동화 할 수 있습니다. -여기에 있는 Go 소스 파일은 `?ts=4`를 붙이기 [전에는](https://github.com/pengwynn/flint/blob/master/flint/flint.go) 이렇습니다. +여기에 있는 Go 소스 파일은 `?ts=4`를 붙이기 전에는 이렇습니다. ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) -그리고 `?ts=4`를 붙인 [다음에는](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4) 이렇게 됩니다. +그리고 `?ts=4`를 붙인 다음에는 이렇게 됩니다. --allow-empty ![After, tab space example](http://i.imgur.com/70FL4H9.png) @@ -98,7 +98,7 @@ diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값 https://github.com/rails/rails/commits/master?author=dhh ``` -![DHH commit history](http://i.imgur.com/mDWwuaY.png) +![DHH commit history](http://i.imgur.com/S7AE29b.png) [*커밋 뷰간의 차이에 대해 더 읽어보세요.*](https://help.github.com/articles/differences-between-commit-views) @@ -125,21 +125,7 @@ https://github.com/{user}/{repo}/branches 여기에서 버튼 클릭으로 비교 페이지나 브랜치 삭제를 하실 수 있습니다. -![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) - -하지만, 보통 `master`보다는 다른브랜치(예를 들어 `development`)를 더 자주 비교 합니다. 이렇게 하려면 URL에 브랜치 이름을 붙여줄 필요가 있습니다. - -``` -https://github.com/{user}/{repo}/branches/{branch} -``` - -![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) - -머지된 브랜치들을 보려면 URL에 `?merged=1`를 붙이세요. - -![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) - -이 것을 확인함으로써 커맨드 라인을 사용하지 않은 페이지에서의 브랜치 삭제가 더 쉬워집니다. +![Compare branches not merged into master in rails/rails repo - https://github.com/rails/rails/branches](http://i.imgur.com/0FEe30z.png) #### Comparing Branches @@ -157,7 +143,7 @@ https://github.com/user/repo/compare/{range} https://github.com/rails/rails/compare/master...4-1-stable ``` -![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) +![Rails branch compare example](http://i.imgur.com/tIRCOsK.png) `{range}` 는 이렇게 적을 수도 있습니다. @@ -179,7 +165,7 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master 포크된 저장소간의 브랜치를 비교하려면 URL을 이렇게 변경하세요. ``` -https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +https://github.com/{user}/{repo}/compare/{foreign-user}:{branch}...{own-branch} ``` 예를 들면 @@ -204,9 +190,9 @@ Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다. $ git clone https://gist.github.com/tiimgreen/10545817 ``` -![Gists](http://i.imgur.com/dULZXXo.png) +![Gists](http://i.imgur.com/BcFzabp.png) -이는 Gists에서도 수정하고 업데이트를 부쉬할 수 있다는 의미입니다. +이는 Gists에서도 수정하고 업데이트를 푸쉬할 수 있다는 의미입니다. ```bash $ git commit @@ -332,19 +318,7 @@ puts table.to_s ### Emojis -에모지는 풀 리퀘스트, 이슈, 커밋 메세지, README등에 `:에모지의_이름:`으로 넣을 수 있습니다. - -``` -:smile: -:poop: -:shipit: -:+1: -``` - -:smile: -:poop: -:shipit: -:+1: +에모지는 풀 리퀘스트, 이슈, 커밋 메세지등에 `:에모지의_이름:`으로 넣을 수 있습니다. 깃허브에서 사용 가능한 에모지의 전 목록은 [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 나 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. @@ -394,6 +368,14 @@ puts table.to_s [*빠른 인용에 대해 더 읽어 보세요.*](https://github.com/blog/1399-quick-quotes) +### Pasting Clipboard Image to Comments + +스크린샷을 찍고 클립보드에 있는 경우 (mac: `cmd-ctrl-shift-4`), 간단히 이미지를 커맨트 색션에 붙여넣기(`cmd-v / ctrl-v`)할 수 있고 이는 자동으로 깃허브에 업로드 됩니다. + +![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) + +[*issue attachments에 대해 더 읽어 보세요.*](https://help.github.com/articles/issue-attachments) + ### Quick Licensing 저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. @@ -587,16 +569,6 @@ $ hub clone tiimgreen/toc [*Hub가 제공하는 더 멋진 기능들을 확인해 보세요.*](https://github.com/github/hub#commands) -### Decreasing Contributor Friction - -사람들이 사용하고 기여할 수 있는 프로젝트를 만드려면, 가장 기본적인 질문에 대답할 수 있어야합니다. 이 프로젝트는 무엇입니까? 어떻게 사용합니까? 어디까지 허용됩니까? 어떻게 기여합니까? 어떻게 개발하고 실행해야 합니까? 어떻게 새로운 기능이 이전 기능을 손상되지 않았는지 확인해야 합니까? - -[Friction](https://github.com/rafalchmiel/friction)은 이러한 일반적인 [질문들의 답](https://github.com/rafalchmiel/friction/wiki)이 프로젝트 안에 있는지 확인하는 커맨드 라인 스크립트 입니다. 다음은 샘플 출력 입니다. - -[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) - -*Friction 은 MRI 2.1.0, MRI 2.0.0, MRI 1.9.3을 지원합니다.* - ### Contributing Guidelines 저장소의 제일 위에 `CONTRIBUTING` 파일을 넣어두면 기여자가 이슈를 만들거나 풀 리퀘스트를 만들 때 링크로 보여줍니다. @@ -757,7 +729,7 @@ $ git commit -m "Big-ass commit" --allow-empty $ git status ``` -![git status](http://i.imgur.com/o3PEHAA.png) +![git status](http://i.imgur.com/qjPyvXb.png) 이렇게 바뀝니다. @@ -765,7 +737,7 @@ $ git status $ git status -sb ``` -![git status -sb](http://i.imgur.com/xNI1bT0.png) +![git status -sb](http://i.imgur.com/K0OY3nm.png) [*깃 `status` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-status) @@ -779,7 +751,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %C 이렇게 보입니다. -![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](http://i.imgur.com/EARRQyJ.png) +![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](http://i.imgur.com/58eOtkW.png) [Palesz](http://stackoverflow.com/users/88355/palesz)님 고맙습니다. From a2f17ab0ea5d64b69c568f192be31b759e97694a Mon Sep 17 00:00:00 2001 From: Chris Warrick Date: Tue, 20 Jan 2015 12:41:41 +0100 Subject: [PATCH 192/292] fix gist update example --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 80d332e..b72ae27 100644 --- a/README.md +++ b/README.md @@ -186,8 +186,9 @@ This means you also can modify and push updates to Gists: ```bash $ git commit -$ Username for 'https://gist.github.com': -$ Password for 'https://tiimgreen@gist.github.com': +$ git push +Username for 'https://gist.github.com': +Password for 'https://tiimgreen@gist.github.com': ``` [*Read more about creating gists.*](https://help.github.com/articles/creating-gists) From 2585a5660abb63161501e80870a8d78bdbca8549 Mon Sep 17 00:00:00 2001 From: Devin Weaver Date: Tue, 20 Jan 2015 12:29:37 -0500 Subject: [PATCH 193/292] Add chrome only disclaimer The pasting of images from clipboard is chrome only, It is stated in the _read more_ article but anyone who doesn't _read more_ may become confused (like I did). --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 80d332e..328a9da 100644 --- a/README.md +++ b/README.md @@ -348,6 +348,9 @@ When on a comment thread and you want to quote something someone previously said [*Read more about quick quoting.*](https://github.com/blog/1399-quick-quotes) ### Pasting Clipboard Image to Comments + +_(Works on Chrome browsers only)_ + After taking a screenshot and adding it to the clipboard (mac: `cmd-ctrl-shift-4`), you can simply paste (`cmd-v / ctrl-v`) the image into the comment section and it will be auto-uploaded to github. ![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) From cd6f422b86ddd2ee345d65d717cf58d99cb14b8d Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 21 Jan 2015 00:31:45 +0000 Subject: [PATCH 194/292] Emojis no longer supported in READMEs --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 753e401..b72f5dc 100644 --- a/README.md +++ b/README.md @@ -307,11 +307,11 @@ The full list of supported Emojis on GitHub can be found at [emoji-cheat-sheet.c The top 5 used Ejmojis on GitHub are: -1. :shipit: - `:shipit:` -2. :sparkles: - `:sparkles:` -3. :-1: - `:-1:` -4. :+1: - `:+1:` -5. :clap: - `:clap:` +1. `:shipit:` +2. `:sparkles:` +3. `:-1:` +4. `:+1:` +5. `:clap:` ### Images/GIFs Images and GIFs can be added to comments, READMEs etc.: From b509f924830ec76f70b94b7f2a2a95a4d7bb6fa8 Mon Sep 17 00:00:00 2001 From: Guriev Nicholas Date: Wed, 21 Jan 2015 16:26:15 +0300 Subject: [PATCH 195/292] Small fix the example URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b72f5dc..0108cdd 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ From here you can access the compare page or delete a branch with a click of a b To use GitHub to compare branches, change the URL to look like this: ``` -https://github.com/user/repo/compare/{range} +https://github.com/{user}/{repo}/compare/{range} ``` Where `{range} = master...4-1-stable` From b76fb96ee85a5f0bdb216ad193df7fbb8489ea62 Mon Sep 17 00:00:00 2001 From: Jeroen van Warmerdam Date: Wed, 21 Jan 2015 18:07:51 +0100 Subject: [PATCH 196/292] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0108cdd..b592abb 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Here is a Go source file before adding `?ts=4`: ![After, tab space example](http://i.imgur.com/70FL4H9.png) ### Commit History by Author -To view all commits on a repo by author add `?author=username` to the URL. +To view all commits on a repo by author add `?author={user}` to the URL. ``` https://github.com/rails/rails/commits/master?author=dhh @@ -254,7 +254,7 @@ This closes the issue and references the closing commit. ### Cross-Link Issues If you want to link to another issue in the same repository, simple type hash `#` then the issue number, it will be auto-linked. -To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. +To link to an issue in another repository, `{user}/{repo}#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) @@ -323,7 +323,7 @@ Images and GIFs can be added to comments, READMEs etc.: Raw images from the repo can be used by calling them directly.: ``` -![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif) ``` ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) From 22858cff2a4c8ff860d588f8ec3fdca130f40221 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Thu, 22 Jan 2015 11:10:24 +0900 Subject: [PATCH 197/292] Apply small fixes to translations - #103, #102, #99: Apply to all - #101: Apply only ko --- README.ja.md | 22 +++++++++++----------- README.ko.md | 24 +++++++++++++----------- README.zh-cn.md | 22 +++++++++++----------- 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/README.ja.md b/README.ja.md index 53c3215..3906c3d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -85,7 +85,7 @@ GitHub上で差分ページを表示している時、そのURLに`?w=1`を加 ![After, tab space example](http://i.imgur.com/70FL4H9.png) ### 特定のユーザーによるコミット履歴 -特定のユーザーによるあるリポジトリへのコミット履歴のみを参照したい場合は、`?author=username`をURLの末尾に付ける。 +特定のユーザーによるあるリポジトリへのコミット履歴のみを参照したい場合は、`?author={user}`をURLの末尾に付ける。 ``` https://github.com/rails/rails/commits/master?author=dhh @@ -135,7 +135,7 @@ https://github.com/{user}/{repo}/branches/{branch} GitHubのブランチ比較は以下のようなURLで提供されている: ``` -https://github.com/user/repo/compare/{range} +https://github.com/{user}/{repo}/compare/{range} ``` `{range}`を`master...4-1-stable`に変更する。 @@ -196,8 +196,8 @@ This means you also can modify and push updates to Gists: ```bash $ git commit -$ Username for 'https://gist.github.com': -$ Password for 'https://tiimgreen@gist.github.com': +Username for 'https://gist.github.com': +Password for 'https://tiimgreen@gist.github.com': ``` @@ -264,7 +264,7 @@ $ git commit -m "Fix screwup, fixes #12" ### issueの相互リンク 同じリポジトリの違うissueへリンクを張り参照させたい場合、`#`に続けてissue番号を指定する。そうすると自動的にリンクが作成されるだろう。 -別のリポジトリのissueの場合は`user_name/repo_name#ISSUE_NUMBER`とすれば良い(例: `tiimgreen/toc#12`)。 +別のリポジトリのissueの場合は`{user}/{repo}#ISSUE_NUMBER`とすれば良い(例: `tiimgreen/toc#12`)。 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) @@ -324,11 +324,11 @@ GitHubでサポートされているEmojiの完全なリストは[Emoji cheat sh GitHubで使われているEmojiのトップ5は以下の通りだ: -1. :shipit: - `:shipit:` -2. :sparkles: - `:sparkles:` -3. :-1: - `:-1:` -4. :+1: - `:+1:` -5. :clap: - `:clap:` +1. `:shipit:` +2. `:sparkles:` +3. `:-1:` +4. `:+1:` +5. `:clap:` ### 画像及びアニメーションGIF 画像やアニメーションGIFはコミットのコメントやREADMEなどで利用できる: @@ -340,7 +340,7 @@ GitHubで使われているEmojiのトップ5は以下の通りだ: リポジトリにある画像も直接参照することが出来る: ``` -![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif) ``` ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) diff --git a/README.ko.md b/README.ko.md index 3dcec64..968853b 100644 --- a/README.ko.md +++ b/README.ko.md @@ -92,7 +92,7 @@ diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값 ### Commit History by Author -특정 커미터가 한 모든 커밋을 보고 싶다면 URL에 `?author=username`를 추가하세요. +특정 커미터가 한 모든 커밋을 보고 싶다면 URL에 `?author={user}`를 추가하세요. ``` https://github.com/rails/rails/commits/master?author=dhh @@ -132,7 +132,7 @@ https://github.com/{user}/{repo}/branches 깃허브에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세요. ``` -https://github.com/user/repo/compare/{range} +https://github.com/{user}/{repo}/compare/{range} ``` `{range}`는 `master...4-1-stable`식으로 적습니다. @@ -196,8 +196,8 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ```bash $ git commit -$ Username for 'https://gist.github.com': -$ Password for 'https://tiimgreen@gist.github.com': +Username for 'https://gist.github.com': +Password for 'https://tiimgreen@gist.github.com': ``` [*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) @@ -268,7 +268,7 @@ $ git commit -m "Fix screwup, fixes #12" 같은 저장소의 다른 이슈를 링크하기 원한다면, `#`뒤에 이슈 번호만 입력하시면 자동으로 링크됩니다. -다른 저장소의 이슈를 링크하고 싶다면 `사람_이름/저장소_이름#이슈_번호`로 할 수 있습니다. (예 `tiimgreen/toc#12`) +다른 저장소의 이슈를 링크하고 싶다면 `{user}/{repo}#이슈_번호`로 할 수 있습니다. (예 `tiimgreen/toc#12`) ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) @@ -324,11 +324,11 @@ puts table.to_s 깃허브에서 많이 사용하는 에모지 탑 5위는 이렇습니다. -1. :shipit: - `:shipit:` -2. :sparkles: - `:sparkles:` -3. :-1: - `:-1:` -4. :+1: - `:+1:` -5. :clap: - `:clap:` +1. `:shipit:` +2. `:sparkles:` +3. `:-1:` +4. `:+1:` +5. `:clap:` ### Images/GIFs @@ -341,7 +341,7 @@ puts table.to_s 저장소에 있는 이미지는 직접 불러서 사용할 수 있습니다. ``` -![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif) ``` ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) @@ -370,6 +370,8 @@ puts table.to_s ### Pasting Clipboard Image to Comments +_(크롬에서만 동작합니다)_ + 스크린샷을 찍고 클립보드에 있는 경우 (mac: `cmd-ctrl-shift-4`), 간단히 이미지를 커맨트 색션에 붙여넣기(`cmd-v / ctrl-v`)할 수 있고 이는 자동으로 깃허브에 업로드 됩니다. ![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) diff --git a/README.zh-cn.md b/README.zh-cn.md index 33a2ee9..2a7cd8c 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -81,7 +81,7 @@ ![After, tab space example](http://i.imgur.com/70FL4H9.png) ### 查看某个用户的Commit历史 -查看某个用户的所有提交历史,只需在commits页面URL后加上`?author=username`。 +查看某个用户的所有提交历史,只需在commits页面URL后加上`?author={user}`。 ``` https://github.com/rails/rails/commits/master?author=dhh @@ -133,7 +133,7 @@ https://github.com/{user}/{repo}/branches/{branch} 如果我们想要比较两个分支,可以像下面一样修改URL: ``` -https://github.com/user/repo/compare/{range} +https://github.com/{user}/{repo}/compare/{range} ``` 其中`{range} = master...4-1-stable` @@ -197,8 +197,8 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ```bash $ git commit -$ Username for 'https://gist.github.com': -$ Password for 'https://tiimgreen@gist.github.com': +Username for 'https://gist.github.com': +Password for 'https://tiimgreen@gist.github.com': ``` @@ -268,7 +268,7 @@ $ git commit -m "Fix screwup, fixes #12" ### 链接其他仓库的Issue 如果你想引用到同一个仓库中的一个Issue,只需使用井号 `#` 加上Issue号,这样就会自动创建到此Issue的链接。 -要链接到其他仓库的Issue,就使用`user_name/repo_name#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 +要链接到其他仓库的Issue,就使用`{user}/{repo}#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) @@ -317,11 +317,11 @@ Github支持的完整表情符号列表详见[emoji-cheat-sheet.com](http://www. Github上使用最多的5个表情符号是: -1. :shipit: - `:shipit:` -2. :sparkles: - `:sparkles:` -3. :-1: - `:-1:` -4. :+1: - `:+1:` -5. :clap: - `:clap:` +1. `:shipit:` +2. `:sparkles:` +3. `:-1:` +4. `:+1:` +5. `:clap:` ### 静态与动态图片 注释和README等文件里也可以使用图片和GIF动画: @@ -333,7 +333,7 @@ Github上使用最多的5个表情符号是: 仓库中的原始图片可以被直接调用: ``` -![Alt Text](https://github.com/(user)/(repo)/raw/master/path/to/image.gif) +![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif) ``` ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) From e3d7dbeb116bb2b1f0f040d65cab42ec77a858b3 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Thu, 22 Jan 2015 11:14:18 +0900 Subject: [PATCH 198/292] Fix typo Ejmojis -> Emojis --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b592abb..bfc286a 100644 --- a/README.md +++ b/README.md @@ -305,7 +305,7 @@ Emojis can be added to Pull Requests, Issues, commit messages, etc. using `:name 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). -The top 5 used Ejmojis on GitHub are: +The top 5 used Emojis on GitHub are: 1. `:shipit:` 2. `:sparkles:` From 7e5df885da620a8cb273b43602c7365351a19e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 22 Jan 2015 13:49:38 -0800 Subject: [PATCH 199/292] Remove reference the Command Bar Command Bar is no more. Now the search field is a plain text field that only searches within the current repo. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index b592abb..25cdb38 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ When on a repository page, keyboard shortcuts allow you to navigate easily. - Pressing `t` will bring up a file explorer. - Pressing `w` will bring up the branch selector. - - Pressing `s` will select the Command Bar. + - Pressing `s` will focus the search field. - Pressing `l` will edit labels on existing Issues. - 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. @@ -225,8 +225,6 @@ To see all of the shortcuts for the current page press `?`: ![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) -[*Read more about using the Command Bar.*](https://help.github.com/articles/using-the-command-bar) - ### Line Highlighting in Repositories Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. From 6d912222f264cd19eed3893745ed77452eed40c4 Mon Sep 17 00:00:00 2001 From: Shaun McCance Date: Fri, 23 Jan 2015 01:50:59 -0500 Subject: [PATCH 200/292] Typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b72f5dc..b4dd730 100644 --- a/README.md +++ b/README.md @@ -252,7 +252,7 @@ This closes the issue and references the closing commit. [*Read more about closing Issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) ### Cross-Link Issues -If you want to link to another issue in the same repository, simple type hash `#` then the issue number, it will be auto-linked. +If you want to link to another issue in the same repository, simply type hash `#` then the issue number, and it will be auto-linked. To link to an issue in another repository, `user_name/repo_name#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. From dec61ac952edb069602ff1105f785a99d689c109 Mon Sep 17 00:00:00 2001 From: Javier Arce Date: Fri, 23 Jan 2015 10:34:55 +0100 Subject: [PATCH 201/292] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfc286a..2cf3348 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ Pull Requests and Issues can now be locked by owners or collaborators of the rep ![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) -This means that users who are not collaborators on the proejct will no longer be able to comment. +This means that users who are not collaborators on the project will no longer be able to comment. ![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) From d67bb89ceef50c3ae34e6e462e8c3a6521faf956 Mon Sep 17 00:00:00 2001 From: Wolfgang Teuber Date: Fri, 23 Jan 2015 22:36:10 +0100 Subject: [PATCH 202/292] Gists do not support directories --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 109f392..6cd3387 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ https://github.com/rails/rails/compare/byroot:master...master 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. -Gists can be treated as a full repository so they can be cloned like any other: +Gists can be treated as a repository so they can be cloned like any other: ```bash $ git clone https://gist.github.com/tiimgreen/10545817 @@ -191,7 +191,8 @@ Username for 'https://gist.github.com': Password for 'https://tiimgreen@gist.github.com': ``` -[*Read more about creating gists.*](https://help.github.com/articles/creating-gists) +However, Gists do not support directories. All files need to be added to the repository root. +[*Read more about creating Gists.*](https://help.github.com/articles/creating-gists) ### Git.io [Git.io](http://git.io) is a simple URL shortener for GitHub. From 7d4ef47a3aafbba4207252f0995c3636f93519b5 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 25 Jan 2015 16:54:36 +0000 Subject: [PATCH 203/292] Add diff/patch view for comparing branches, closes #106 --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ff61ec4..f1f8eb4 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,12 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ![Another compare example](http://i.imgur.com/5dtzESz.png) -...which allows you to see the difference on the master branch up a set time ago or a specified date. +Branches can also be compared in `diff` and `patch` views: + +``` +https://github.com/rails/rails/compare/master...4-1-stable.diff +https://github.com/rails/rails/compare/master...4-1-stable.patch +``` [*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) From 510e04364e277fc5720c96b72c5ea779bba5d2a5 Mon Sep 17 00:00:00 2001 From: Specode <0x0000e000@gmail.com> Date: Mon, 26 Jan 2015 10:57:59 +0800 Subject: [PATCH 204/292] update git alias link --- README.zh-cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index d0f3f2e..366f735 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -699,7 +699,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s 这要归功于[Palesz](http://stackoverflow.com/users/88355/palesz)在stackoverflow的回答。 -*这个命令可以被用作别名,详细做法见[这里](https://github.com/tiimgreen/github-cheat-sheet#aliases)。* +*这个命令可以被用作别名,详细做法见[这里](#git%E5%91%BD%E4%BB%A4%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%AB%E5%90%8D)。* [*进一步了解 Git `log` 命令.*](http://git-scm.com/docs/git-log) From f67e9b5e979d71e1f4fc98d72c5fc60909770fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 26 Jan 2015 16:07:24 -0800 Subject: [PATCH 205/292] More tips on GitHub search --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 25cdb38..c26e4c9 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ When on a repository page, keyboard shortcuts allow you to navigate easily. - Pressing `t` will bring up a file explorer. - Pressing `w` will bring up the branch selector. - - Pressing `s` will focus the search field. + - Pressing `s` will focus the search field for the current repository. Pressing Backspace to delete the “This repository” pill changes the field to search all of GitHub. - Pressing `l` will edit labels on existing Issues. - 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. @@ -225,6 +225,8 @@ To see all of the shortcuts for the current page press `?`: ![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) +[Read more about search syntax you can use.](https://help.github.com/articles/search-syntax/) + ### Line Highlighting in Repositories Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. From 09aa1c9b6753ab8a11af4960e9081895ca1f05e1 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Tue, 27 Jan 2015 10:54:57 +0100 Subject: [PATCH 206/292] github-tab-size is not just a Chrome extension --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1f8eb4..f65a83f 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli [*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) ### Adjust Tab Space -Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome extension](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) can automate this. +Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) or [Opera extension](https://addons.opera.com/en/extensions/details/github-tab-size/) can automate this. Here is a Go source file before adding `?ts=4`: From 45cec697748298d295f5dbc9c3b3b568c6f03804 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Wed, 28 Jan 2015 10:10:21 +0900 Subject: [PATCH 207/292] Update Korean to 652eae6 --- README.ko.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/README.ko.md b/README.ko.md index 2cbbffb..1eec567 100644 --- a/README.ko.md +++ b/README.ko.md @@ -80,7 +80,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c ### Adjust Tab Space -diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값인 8대신 4공백으로 보여줍니다. `ts`뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw파일 보기에는 적용 되지 않습니다만, [크롬 익스텐션](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)으로 자동화 할 수 있습니다. +diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값인 8대신 4공백으로 보여줍니다. `ts`뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw파일 보기에는 적용 되지 않습니다만, [크롬 익스텐션](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)이나 [오페라 익스텐션](https://addons.opera.com/en/extensions/details/github-tab-size/)으로 자동화 할 수 있습니다. 여기에 있는 Go 소스 파일은 `?ts=4`를 붙이기 전에는 이렇습니다. @@ -156,7 +156,12 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ![Another compare example](http://i.imgur.com/5dtzESz.png) -이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다. +브랜치는 `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) @@ -184,7 +189,7 @@ https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master [이렇게](https://gist.github.com/tiimgreen/10545817.pibb) Gist URL뒤에 `.pibb`를 넣으면 다른 사이트에 넣을수 있는 *HTML 온리* 버전을 만들 수 있습니다. -Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다. +Gists는 저장소처럼 취급할 수 있고 클론도 됩니다. ```bash $ git clone https://gist.github.com/tiimgreen/10545817 @@ -200,7 +205,8 @@ Username for 'https://gist.github.com': Password for 'https://tiimgreen@gist.github.com': ``` -[*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) +하지만, Gists는 디랙토리를 지원하지 않습니다. 모든 파일은 저장소의 루트에 넣을 필요가 있습니다. +[*Gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) ### Git.io @@ -228,7 +234,7 @@ Location: https://github.com/... - `t`를 누르면 파일 탐색 페이지로 이동합니다. - `w`를 누르면 브렌치 선택 페이지로 이동합니다. - - `s`를 누르면 커맨드 창으로 이동합니다. + - `s`를 누르면 지금 저장소의 검색창이 포커스됩니다. 백스페이스를 누르면 채워져 있는 "This repository"를 지워 GitHub전체에서 검색할 수 있게 됩니다. - `l`를 누르면 있는 이슈의 라벨을 수정할 수 있습니다. - __파일을 보고 있을 때__ (예를 들어 `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`) `y`를 누르면 URL을 지금 보고 있는 페이지를 사실상 고정하도록 합니다. 코드가 바뀐다고 해도 이번에 본 내용을 다시 볼 수 있습니다. @@ -236,7 +242,7 @@ Location: https://github.com/... ![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) -[*커맨드 바의 사용법을 더 읽어 보세요.*](https://help.github.com/articles/using-the-command-bar) +[*사용할 수 있는 검색 문법에 대해 더 읽어 보세요.*](https://help.github.com/articles/search-syntax/) ### Line Highlighting in Repos @@ -278,7 +284,7 @@ $ git commit -m "Fix screwup, fixes #12" ![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) -이는 프로젝트의 협업자가 아닌 사람은 더이상 커맨트를 달 수 없게된다는 말입니다. +이는 프로젝트의 협업자가 아닌 사람은 더 이상 커맨트를 달 수 없게된다는 말입니다. ![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) From 76fecf40cf3428b85c333038afd8086222b1fe6d Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Sat, 14 Feb 2015 19:46:30 +0900 Subject: [PATCH 208/292] Update Ja translation to 086595f --- README.ja.md | 76 +++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/README.ja.md b/README.ja.md index 2969f62..713d8f3 100644 --- a/README.ja.md +++ b/README.ja.md @@ -26,6 +26,7 @@ - [画像及びアニメーション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) @@ -74,13 +75,13 @@ GitHub上で差分ページを表示している時、そのURLに`?w=1`を加 [*GitHubの秘密についてもっと詳しく*](https://github.com/blog/967-github-secrets) ### タブ幅の調節 -差分やファイルを表示している時、URLに`?ts=4`を追加するとタブを空白4つの幅で表示する。デフォルトは8つだ。`ts`に指定した数で表示されるということだ。これはGistやrawファイルを表示している時には適用されない。 +差分やファイルを表示している時、URLに`?ts=4`を追加するとタブを空白4つの幅で表示する。デフォルトは8つだ。`ts`に指定した数で表示されるということだ。これはGistやrawファイルを表示している時には適用されないが、[Chrome](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)と[Operaの拡張](https://addons.opera.com/en/extensions/details/github-tab-size/)をインストールすることにより、対応することができる。 -例えば[Goのソースファイル](https://github.com/pengwynn/flint/blob/master/flint/flint.go)を表示している時、`?ts=4`を追加する前はこのように表示されるが: +例えばGoのソースファイルを表示している時、`?ts=4`を追加する前はこのように表示されるが: ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) -`?ts=4`を[追加すると](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4)このように表示される: +`?ts=4`を追加するとこのように表示される: ![After, tab space example](http://i.imgur.com/70FL4H9.png) @@ -90,7 +91,7 @@ GitHub上で差分ページを表示している時、そのURLに`?w=1`を加 ``` https://github.com/rails/rails/commits/master?author=dhh ``` -![DHH commit history](http://i.imgur.com/mDWwuaY.png) +![DHH commit history](http://i.imgur.com/S7AE29b.png) [*コミット・ビューの違いについてもっと詳しく*](https://help.github.com/articles/differences-between-commit-views) @@ -115,21 +116,7 @@ https://github.com/{user}/{repo}/branches このページからボタンをクリックしてブランチ比較ページへ移動したりブランチを削除することができる。 -![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) - -しかしながら`master`以外、(例えば`development`)のブランチと比較したい場合もあるだろう。その場合、以下のようにURLの最後にそのブランチ名を追加すれば良い: - -``` -https://github.com/{user}/{repo}/branches/{branch} -``` - -![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) - -マージ済みのブランチを表示するには`?merged=1`をURLに追加する。 - -![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) - -このビューでは、コマンドラインを使うことなく簡単にページ上でブランチを削除することができるだろう。 +![Compare branches not merged into master in rails/rails repo - https://github.com/rails/rails/branches](http://i.imgur.com/0FEe30z.png) #### ブランチ同士の比較 GitHubのブランチ比較は以下のようなURLで提供されている: @@ -145,7 +132,7 @@ https://github.com/{user}/{repo}/compare/{range} ``` https://github.com/rails/rails/compare/master...4-1-stable ``` -![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) +![Rails branch compare example](http://i.imgur.com/tIRCOsK.png) `{range}`には以下のように変更することもできる: @@ -158,7 +145,12 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ![Another compare example](http://i.imgur.com/5dtzESz.png) -するとmasterブランチと特定の期間または日時との比較が行えるだろう。 +`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) @@ -184,22 +176,24 @@ https://github.com/rails/rails/compare/byroot:master...master GistのURLの最後に`.pibb`を付ける([例](https://gist.github.com/hail2u/9477708.pibb))と*HTMLのみ*のバージョンが表示されるので、そのソースは他のウェブサイトに貼り付けるにはもってこいだろう。 -簡単なものとはいえ、完全なGitリポジトリとして機能するため、以下のようにすれば普通のGitリポジトリと同じようにクローンすることができる: +簡単なものとはいえ、Gitリポジトリとして機能するため、以下のようにすれば普通のGitリポジトリと同じようにクローンすることができる: ```bash $ git clone https://gist.github.com/tiimgreen/10545817 ``` -![Gists](http://i.imgur.com/dULZXXo.png) +![Gists](http://i.imgur.com/BcFzabp.png) 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) @@ -227,7 +221,7 @@ Location: https://github.com/... - `t`を押すとファイルの検索インターフェイスが起動する。 - `w`を押すとブランチ選択インターフェイスが起動する。 - - `s`を押すとコマンド・バーにフォーカスが当たる。 + - `s`を押すと現在閲覧しているリポジトリーから検索するフォームにフォーカスが当たる。ここでBackspaceを押し「This repository」という文字列を消すことでGitHub全体からの検索へと切り替えることができる - issue画面で`l`を押すとラベルの編集インターフェイスが開かれる。 - __ファイルを参照している時__(例: `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`)に`y`を押すと、参照している時の状態で固定されるURLに変更される。つまりそのファイルのコードが後に変化したとしても、そのURLでは今とまったく同じ状態で表示されるということだ。 @@ -235,7 +229,7 @@ Location: https://github.com/... ![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) -[*コマンドバーについてもっと詳しく*](https://help.github.com/articles/using-the-command-bar) +[*検索機能についてもっと詳しく*](https://help.github.com/articles/search-syntax/) ### コードの指定行の強調 コードのURLの末尾に`#L52`と付けるか行番号をクリックすると、その行が強調表示される。 @@ -312,14 +306,6 @@ GitHubでは[Linguist](https://github.com/github/linguist)を使って言語を ### Emoji Emojiはpull requestやissue、READMEなどで`:name_of_emoji:`と書くと利用できる: -``` -:smile: -``` - -こう書くと以下のように表示される: - -:smile: - 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)で確認できる。 GitHubで使われているEmojiのトップ5は以下の通りだ: @@ -365,6 +351,16 @@ issueのスレッドで他の人のコメントを引用してコメントした [*素早く引用する方法についてもっと詳しく*](https://github.com/blog/1399-quick-quotes) +### コメントへのクリップボードの画像の追加 + +_(Chrome系のブラウザーのみで動作)_ + +スクリーンショットをクリップボードに保存(mac: `cmd-ctrl-shift-4`)した後、その画像はコメント投稿フォームで貼り付け(`cmd-v`または`ctrl-v`)ることができ、自動的にGitHubへアップロードされます。 + +![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) + +[*コメントへのクリップボードの画像の追加についてもっと詳しく*](https://help.github.com/articles/issue-attachments) + ### 設定済みライセンスの追加 GitHub上でリポジトリを作成する時、あらかじめ設定されているライセンスを追加することもできる: @@ -546,13 +542,6 @@ $ git clone https://github.com/tiimgreen/toc.git [*Hubが提供する便利な機能についてもっと詳しく*](https://github.com/github/hub#commands) -### 共同開発者との摩擦の軽減 -もし誰かに自分のプロジェクトの利用またはその開発に参加してもらいたい場合、まずはよくある質問に答えることから始めなければならないだろう。このプロジェクトはどういうものなのか?どうやって使うのか?どのように使っても良いのか?どうやれば開発に参加できるのか?どうやれば開発環境を用意できるのか?どうやって自分の加えた機能が既存の機能を破壊しないことが確認できるのか? - -[Friction](https://github.com/rafalchmiel/friction)はこういった[一般的な質問に対しての答え](https://github.com/rafalchmiel/friction/wiki)が用意されているかをチェックしてくれるコマンドライン・ツールだ。例えば以下のような出力を得られる: - -[![Friction output](http://i.imgur.com/4EgpWo4.png)](https://github.com/rafalchmiel/friction) - ### 開発参加のガイドライン リポジトリのルートに`CONTRIBUTING`という名前のファイルを置くと、issueやpull requestを作成しようとした時にそれへのリンクが表示されるようになる。 @@ -696,7 +685,7 @@ $ git status このように表示されるが: -![git status](http://i.imgur.com/o3PEHAA.png) +![git status](http://i.imgur.com/qjPyvXb.png) `-sb`を追加することによって: @@ -706,7 +695,7 @@ $ git status -sb このように表示することもできる: -![git status -sb](http://i.imgur.com/xNI1bT0.png) +![git status -sb](http://i.imgur.com/K0OY3nm.png) [*Gitの`status`コマンドについてもっと詳しく*](http://git-scm.com/docs/git-status) @@ -719,7 +708,7 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %C このように表示される: -![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](http://i.imgur.com/EARRQyJ.png) +![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](http://i.imgur.com/58eOtkW.png) この設定は[Palesz](http://stackoverflow.com/users/88355/palesz)が考えたものだ。 @@ -834,6 +823,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 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 --"` | From dda655e494bd36d41d2b76ecdaa343b9cd788ea6 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 18 Feb 2015 21:15:24 +0000 Subject: [PATCH 209/292] Emojis can be added to repo descriptions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e17bc41..ee97912 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,7 @@ GitHub uses [Linguist](https://github.com/github/linguist) to perform language d [*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) ### Emojis -Emojis can be added to Pull Requests, Issues, commit messages, etc. using `:name_of_emoji:` +Emojis can be added to Pull Requests, Issues, commit messages, repository descriptions, etc. using `:name_of_emoji:`. 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). From 53e3a65c73be3b96ce3df4dfb7f507d1239165ae Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 18 Feb 2015 22:04:12 +0000 Subject: [PATCH 210/292] Add 'Remove All Deleted Files from the Working Tree' command (see #104) --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index ee97912..9da0195 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [Git](#git) + - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - [Previous Branch](#previous-branch) - [Stripspace](#stripspace) - [Checking out Pull Requests](#checking-out-pull-requests) @@ -578,6 +579,33 @@ GitHubs icons (Octicons) have now been open sourced. | More Git and GitHub Secrets | https://www.youtube.com/watch?v=p50xsL-iVgU | ## Git +### Remove All Deleted Files from the Working Tree +When you delete a lot of files using `/bin/rm` you can use the following command to remove them from the working tree and from the index, eliminating the need to remove each one individually: + +```bash +$ git rm $(git ls-files -d) +``` + +For example: + +```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 +``` + ### Previous Branch To move to the previous branch in Git: From ea4fc8580d059b3cea44022e374e8267852cd232 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Wed, 18 Feb 2015 22:21:41 +0000 Subject: [PATCH 211/292] Remove :trollface: as it doesn't work --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9da0195..97029b7 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Previous Branch](#previous-branch) - [Stripspace](#stripspace) - [Checking out Pull Requests](#checking-out-pull-requests) - - [Empty Commits :trollface:](#empty-commits-trollface) + - [Empty Commits](#empty-commits) - [Styled Git Status](#styled-git-status) - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) @@ -692,7 +692,7 @@ git checkout pr/42 [*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) -### Empty Commits :trollface: +### Empty Commits Commits can be pushed with no code changes by adding `--allow-empty`: ```bash From 5e2969671d4800aa928cb2b13c2b22b0c1250520 Mon Sep 17 00:00:00 2001 From: wolfg1969 Date: Thu, 19 Feb 2015 15:36:20 +0800 Subject: [PATCH 212/292] update zh-cn translations to ea4fc85 --- README.zh-cn.md | 483 +++++++++++++++++++++++++++--------------------- 1 file changed, 274 insertions(+), 209 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 366f735..8d83553 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -1,98 +1,103 @@ # GitHub秘籍 -本秘籍收录了一些Git和Github非常酷同时又少有人知的功能。灵感来自于[Zach Holman](https://github.com/holman)在2012年Aloha Ruby Conference和2013年WDCNZ上所做的演讲:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets))和[More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 +Git 和 Github 秘籍,灵感来自于 [Zach Holman](https://github.com/holman) 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演讲:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets)) 和 [More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 -*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* +*其他语言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* # 目录 - - [GitHub](#github) - - [忽略空白字符变化](#%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) - - [调整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%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) - - [整行高亮](#%E6%95%B4%E8%A1%8C%E9%AB%98%E4%BA%AE) - - [用commit信息关闭Issue](#%E7%94%A8commit%E4%BF%A1%E6%81%AF%E5%85%B3%E9%97%ADissue) - - [链接其他仓库的Issue](#%E9%93%BE%E6%8E%A5%E5%85%B6%E4%BB%96%E4%BB%93%E5%BA%93%E7%9A%84issue) - - [设置CI对每条Pull Request都进行构建](#%E8%AE%BE%E7%BD%AEci%E5%AF%B9%E6%AF%8F%E6%9D%A1pull-request%E9%83%BD%E8%BF%9B%E8%A1%8C%E6%9E%84%E5%BB%BA) - - [Markdown文件高亮语法](#markdown%E6%96%87%E4%BB%B6%E9%AB%98%E4%BA%AE%E8%AF%AD%E6%B3%95) - - [表情符](#%E8%A1%A8%E6%83%85%E7%AC%A6) - - [静态与动态图片](#%E9%9D%99%E6%80%81%E4%B8%8E%E5%8A%A8%E6%80%81%E5%9B%BE%E7%89%87) - - [在GitHub Wiki中嵌入图片](#%E5%9C%A8github-wiki%E4%B8%AD%E5%B5%8C%E5%85%A5%E5%9B%BE%E7%89%87) - - [快速引用](#%E5%BF%AB%E9%80%9F%E5%BC%95%E7%94%A8) - - [快速添加许可证](#%E5%BF%AB%E9%80%9F%E6%B7%BB%E5%8A%A0%E8%AE%B8%E5%8F%AF%E8%AF%81) - - [任务列表](#%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) - - [Markdown文件中的任务列表](#markdown%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8) - - [相对链接](#%E7%9B%B8%E5%AF%B9%E9%93%BE%E6%8E%A5) - - [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) - - [在diff中折叠与扩展代码](#%E5%9C%A8diff%E4%B8%AD%E6%8A%98%E5%8F%A0%E4%B8%8E%E6%89%A9%E5%B1%95%E4%BB%A3%E7%A0%81) - - [查看Pull Request的diff和patch](#%E6%9F%A5%E7%9C%8Bpull-request%E7%9A%84diff%E5%92%8Cpatch) - - [渲染图像发生的变动](#%E6%B8%B2%E6%9F%93%E5%9B%BE%E5%83%8F%E5%8F%91%E7%94%9F%E7%9A%84%E5%8F%98%E5%8A%A8) - - [Hub](#hub) - - [贡献者指南](#%E8%B4%A1%E7%8C%AE%E8%80%85%E6%8C%87%E5%8D%97) - - [GitHub资源](#github%E8%B5%84%E6%BA%90) - - [GitHub讨论](#github%E8%AE%A8%E8%AE%BA) - - [Git](#git) - - [前一个分支](#%E5%89%8D%E4%B8%80%E4%B8%AA%E5%88%86%E6%94%AF) - - [Stripspace命令](#stripspace%E5%91%BD%E4%BB%A4) - - [检出Pull Requests](#%E6%A3%80%E5%87%BApull-requests) - - [提交空改动 :trollface:](#%E6%8F%90%E4%BA%A4%E7%A9%BA%E6%94%B9%E5%8A%A8-trollface) - - [更直观的Git Status](#%E6%9B%B4%E7%9B%B4%E8%A7%82%E7%9A%84git-status) - - [更直观的Git Log](#%E6%9B%B4%E7%9B%B4%E8%A7%82%E7%9A%84git-log) - - [Git查询](#git%E6%9F%A5%E8%AF%A2) - - [合并分支](#%E5%90%88%E5%B9%B6%E5%88%86%E6%94%AF) - - [使用网页查看本地仓库](#%E4%BD%BF%E7%94%A8%E7%BD%91%E9%A1%B5%E6%9F%A5%E7%9C%8B%E6%9C%AC%E5%9C%B0%E4%BB%93%E5%BA%93) - - [Git配置](#git%E9%85%8D%E7%BD%AE) - - [Git命令自定义别名](#git%E5%91%BD%E4%BB%A4%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%AB%E5%90%8D) - - [自动更正](#%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%AD%A3) - - [带颜色输出](#%E5%B8%A6%E9%A2%9C%E8%89%B2%E8%BE%93%E5%87%BA) - - [Git资源](#git%E8%B5%84%E6%BA%90) - - [Git参考书籍](#git%E5%8F%82%E8%80%83%E4%B9%A6%E7%B1%8D) + - [GitHub](#github) + - [不比较空白字符](#不比较空白字符) + - [调整 Tab 字符所代表的空格数](#调整-tab-字符所代表的空格数) + - [查看某个用户的 Commit 历史](#查看某个用户的-commit-历史) + - [仓库克隆](#仓库克隆) + - [分支](#分支) + - [将某个分支与其他所有分支进行对比](#将某个分支与其他所有分支进行对比) + - [比较分支](#比较分支) + - [比较不同派生库的分支](#比较不同派生库的分支) + - [Gists](#gists) + - [Git.io](#gitio) + - [键盘快捷键](#键盘快捷键) + - [整行高亮](#整行高亮) + - [用 Commit 信息关闭 Issue](#用-commit-信息关闭-issue) + - [链接其他仓库的 Issue](#链接其他仓库的-issue) + - [锁定项目对话功能](#锁定项目对话功能) + - [设置 CI 对每条 Pull Request 都进行构建](#设置-ci-对每条-pull-request-都进行构建) + - [Markdown 文件语法高亮](#markdown-文件语法高亮) + - [表情符](#表情符) + - [图片 / GIF 动画](#图片--gif-动画) + - [在 GitHub Wiki 中引用图片](#在-github-wiki-中引用图片) + - [快速引用](#快速引用) + - [粘贴剪贴板中的图片到评论](#粘贴剪贴板中的图片到评论) + - [快速添加许可证文件](#快速添加许可证文件) + - [任务列表](#任务列表) + - [Markdown 文件中的任务列表](#markdown-文件中的任务列表) + - [相对链接](#相对链接) + - [GitHub Pages 的元数据与插件支持](#github-pages-的元数据与插件支持) + - [查看 YAML 格式的元数据](#查看-yaml-格式的元数据) + - [渲染表格数据](#渲染表格数据) + - [撤销 Pull Request](#撤销-pull-request) + - [Diffs](#diffs) + - [可渲染文档的Diffs](#可渲染文档的diffs) + - [可比较的地图数据](#可比较的地图数据) + - [在 Diff 中展开查看更多的上下文](#在-diff-中展开查看更多的上下文) + - [获取 Pull Request 的 diff 或 patch 文件](#获取-pull-request-的-diff-或-patch-文件) + - [显示图片以及比较图片](#显示图片以及比较图片) + - [Hub](#hub) + - [贡献者指南](#贡献者指南) + - [Octicons](#octicons) + - [GitHub 资源](#github-资源) + - [GitHub 相关演讲视频](#github-相关演讲视频) + - [Git](#git) + - [从工作区去除大量已删除文件](#从工作区去除大量已删除文件) + - [上一个分支](#上一个分支) + - [去除空白](#去除空白) + - [检出 Pull Requests](#检出-pull-requests) + - [没有任何改动的提交](#没有任何改动的提交) + - [美化 Git Status](#美化-git-status) + - [美化 Git Log](#美化-git-log) + - [Git 查询](#git-查询) + - [合并分支](#合并分支) + - [修复有问题的提交以及自动合并](#修复有问题的提交以及自动合并) + - [以网站方式查看本地仓库](#以网站方式查看本地仓库) + - [Git 配置](#git-配置) + - [Git 命令自定义别名](#git-命令自定义别名) + - [自动更正](#自动更正) + - [颜色输出](#颜色输出) + - [Git 资源](#git-资源) + - [Git 参考书籍](#git-参考书籍) ## GitHub -### 忽略空白字符变化 +### 不比较空白字符 -在任意diff页面的URL后加上`?w=1`,可以去掉那些只是空白字符的变化,使你能更专注于代码的变化。 +在任意 diff 页面的 UR L后加上 `?w=1`,可以去掉那些只是空白字符的改动,使你能更专注于代码改动。 ![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) [*详见 GitHub secrets.*](https://github.com/blog/967-github-secrets) -### 调整Tab字符所代表的空格数 -在diff或者file页面的URL后面加上`?ts=4`,这样当显示tab字符的长度时就会是4个空格的长度,不再是默认的8个空格。`ts`后面的数字还可以根据你个人的偏好进行修改。不过,这个小诀窍在Gists页面和raw file页面不起作用。 +### 调整 Tab 字符所代表的空格数 +在 diff 或文件的 URL 后面加上 `?ts=4` ,这样当显示 tab 字符的长度时就会是 4 个空格的长度,不再是默认的 8 个空格。 `ts` 后面的数字还可以根据你个人的偏好进行修改。这个技巧不适用于 Gists,或者以 Raw 格式查看文件, 但有浏览器扩展插件可以帮你自动调整: [Chrome 扩展](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) , [Opera 扩展](https://addons.opera.com/en/extensions/details/github-tab-size/)。 -下面是我们在Go语言的source file页面URL后加`?ts=4`[前](https://github.com/pengwynn/flint/blob/master/flint/flint.go)的例子: +下面以一个 Go 语言源文件为例,看看在 URL 里添加 `?ts=4` 参数的效果。添加前: ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) -然后是我们添加`?ts=4`[后](https://github.com/pengwynn/flint/blob/master/flint/flint.go?ts=4)的例子: +... 添加后的样子: ![After, tab space example](http://i.imgur.com/70FL4H9.png) -### 查看某个用户的Commit历史 -查看某个用户的所有提交历史,只需在commits页面URL后加上`?author={user}`。 +### 查看某个用户的 Commit 历史 +在 Commits 页面 URL 后加上 `?author={user}` 查看某个用户的所有提交。 ``` https://github.com/rails/rails/commits/master?author=dhh ``` -![DHH commit history](http://i.imgur.com/mDWwuaY.png) +![DHH commit history](http://i.imgur.com/S7AE29b.png) [*深入了解提交视图之间的区别*](https://help.github.com/articles/differences-between-commit-views) -### 克隆某个仓库 -当我们克隆某一资源时,可以不要那个`.git`后缀。 +### 仓库克隆 +当克隆仓库时可以不要那个`.git`后缀。 ```bash $ git clone https://github.com/tiimgreen/github-cheat-sheet @@ -103,40 +108,26 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet ###分支 ####将某个分支与其他所有分支进行对比 -当你点击某个仓库的分支(Branches)选项卡时 +当你查看某个仓库的分支(Branches)页面(紧挨着 Commits 链接)时 ``` https://github.com/{user}/{repo}/branches ``` 你会看到一个包含所有未合并的分支的列表。 -你可以在这里查看比较(Compare)页面或点击删除某个分支。 +在这里你可以访问分支比较页面或删除某个分支。 -![Compare branches not merged into master in jquery/jquery repo - https://github.com/jquery/jquery/branches](http://i.imgur.com/gKWPe8a.png) - -有的时候我们需要将多个分支与一个非主分支(master)进行对比,此时可以通过在URL后加入要比较的分支名来实现: - -``` -https://github.com/{user}/{repo}/branches/{branch} -``` - -![Compare branches not merged into `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master](http://i.imgur.com/jpc6Urb.png) - -可以在URL后加上`?merged=1`来查看已经合并了的分支。 - -![Compare branches merged in to `1.x-master` in jquery/jquery repo - https://github.com/jquery/jquery/branches/1.x-master?merged=1](http://i.imgur.com/KmYyCVh.png) - -你可以使用这个界面来替代命令行直接删除分支。 +![Compare branches not merged into master in rails/rails repo - https://github.com/rails/rails/branches](http://i.imgur.com/0FEe30z.png) #### 比较分支 -如果我们想要比较两个分支,可以像下面一样修改URL: +如果要在 GitHub 上直接比较两个分支,可以使用如下形式的 URL : ``` https://github.com/{user}/{repo}/compare/{range} ``` -其中`{range} = master...4-1-stable` +其中 `{range} = master...4-1-stable` 例如: @@ -144,9 +135,9 @@ https://github.com/{user}/{repo}/compare/{range} https://github.com/rails/rails/compare/master...4-1-stable ``` -![Rails branch compare example](http://i.imgur.com/0Z52X5Y.png) +![Rails branch compare example](http://i.imgur.com/tIRCOsK.png) -`{range}`还可以使用下面的形式: +`{range}` 参数还可以使用下面的形式: ``` https://github.com/rails/rails/compare/master@{1.day.ago}...master @@ -157,13 +148,18 @@ https://github.com/rails/rails/compare/master@{2014-10-04}...master ![Another compare example](http://i.imgur.com/5dtzESz.png) -...这样你就能查看master分支上一段时间或者指定日期内的改动。 +在 `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) +[*了解更多关于基于时间的 Commit 比较.*](https://help.github.com/articles/comparing-commits-across-time) #### 比较不同派生库的分支 -想要对派生仓库(Forked Repository)之间的分支进行比较,可以像下面这样修改URL实现: +想要对派生仓库(Forked Repository)之间的分支进行比较,可以使用如下的 URL: ``` https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} @@ -179,13 +175,13 @@ https://github.com/rails/rails/compare/byroot:master...master ### Gists -[Gists](https://gist.github.com/) 给我们提供了一种不需要创建一个完整的仓库,使小段代码也可以工作的简单方式。 +[Gists](https://gist.github.com/) 方便我们管理代码片段,不必使用功能齐全的仓库。 ![Gist](http://i.imgur.com/VkKI1LC.png?1) -Gist的URL后加上`.pibb`,可以得到更适合嵌入到其他网站的HTML版本。 +Gist 的 URL 后加上 `.pibb`,比如 [like this](https://gist.github.com/tiimgreen/10545817.pibb) ,方便嵌入到其他网站。 -Gists还可以像任何标准仓库一样被克隆。 +Gists 可以像任何标准仓库一样被克隆。 ```bash $ git clone https://gist.github.com/tiimgreen/10545817 @@ -197,19 +193,20 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ```bash $ git commit +$ git push Username for 'https://gist.github.com': Password for 'https://tiimgreen@gist.github.com': ``` - -[*进一步了解如何创建 gists.*](https://help.github.com/articles/creating-gists) +但是, Gists 不支持目录。所有文件都必须添加在仓库的根目录下。 +[*进一步了解如何创建 Gists.*](https://help.github.com/articles/creating-gists) ### Git.io -[Git.io](http://git.io)是Github的短网址服务。 +[Git.io](http://git.io)是 Github 的短网址服务。 ![Git.io](http://i.imgur.com/6JUfbcG.png?1) -你可以通过Curl命令以普通HTTP协议使用它: +你可以通过 Curl 命令以普通 HTTP 协议使用它: ```bash $ curl -i http://git.io -F "url=https://github.com/..." @@ -225,25 +222,25 @@ Location: https://github.com/... ### 键盘快捷键 -在仓库主页上提供了快捷键方便快速导航。 +在仓库页面上提供了快捷键方便快速导航。 - - 按 `t` 键会打开一个文件浏览器。 - - 按 `w` 键会打开分支选择菜单。 - - 按 `s` 键会激活顶端的命令栏 (Command Bar)。 - - 按 `l` 键编辑Issue列表页的标签。 + - 按 `t` 键打开一个文件浏览器。 + - 按 `w` 键打开分支选择菜单。 + - 按 `s` 键聚焦光标到当前仓库的搜索框。此时按退格键就会从搜索当前仓库切换到搜索整个 Github 网站。 + - 按 `l` 键编辑 Issue 列表页的标签。 - **查看文件内容时**(如:`https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`),按 `y` 键将会冻结这个页面,这样就算代码被修改了也不会影响你当前看到的。 按`?`查看当前页面支持的快捷键列表: ![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) -[*进一步了解如何使用 Command Bar.*](https://help.github.com/articles/using-the-command-bar) +[*进一步了解可用的搜索语法.*](https://help.github.com/articles/search-syntax/) ### 整行高亮 -在代码文件地址后加上`#L52`或者单击行号52都会将第52行代码高亮显示。 +在代码文件地址 URL 后加上`#L52`或者单击行号 52 都会将第 52 行代码高亮显示。 -多行高亮也可以,比如用`#L53-L60`选择范围,或者按住 `shift`键,然后再点击选择的两行。 +多行高亮也可以,比如用`#L53-L60`选择范围,或者按住 `shift` 键,然后再点击选择的两行。 ``` https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 @@ -251,36 +248,47 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![整行高亮](http://i.imgur.com/8AhjrCz.png) -### 用commit信息关闭Issue +### 用 Commit 信息关闭 Issue -如果某个提交修复了一个Issue,当提交到master分支时,提交信息里可以使用`fix/fixes/fixed`, `close/closes/closed` 或者 `resolve/resolves/resolved`等关键词,后面再跟上Issue号,这样就会关闭这个Issue。 +如果某个提交修复了一个 Issue,当提交到 master 分支时,提交信息里可以使用 `fix/fixes/fixed`, `close/closes/closed` 或者 `resolve/resolves/resolved` 等关键词,后面再跟上 Issue 号,这样就会关闭这个 Issue 。 ```bash $ git commit -m "Fix screwup, fixes #12" ``` -这将会关闭Issue #12,并且在Issue讨论列表里关联引用这次提交。 +这将会关闭 Issue #12,并且在 Issue 讨论列表里关联引用这次提交。 ![Closing Repo](http://i.imgur.com/Uh1gZdx.png) -[*进一步了解通过提交信息关闭Issue.*](https://help.github.com/articles/closing-issues-via-commit-messages) +[*进一步了解通过提交信息关闭 Issue.*](https://help.github.com/articles/closing-issues-via-commit-messages) -### 链接其他仓库的Issue -如果你想引用到同一个仓库中的一个Issue,只需使用井号 `#` 加上Issue号,这样就会自动创建到此Issue的链接。 +### 链接其他仓库的 Issue +如果你想引用到同一个仓库中的一个 Issue,只需使用井号 `#` 加上 Issue 号,这样就会自动创建到此 Issue 的链接。 -要链接到其他仓库的Issue,就使用`{user}/{repo}#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 +要链接到其他仓库的 Issue ,就使用`{user}/{repo}#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) -### 设置CI对每条Pull Request都进行构建 -如果配置正确,[Travis CI](https://travis-ci.org/)会为每个你收到的Pull Request执行构建,就像每次提交也会触发构建一样。想了解更多关于Travis CI的信息,请看 [Travis CI入门](http://docs.travis-ci.com/user/getting-started/)。 +### 锁定项目对话功能 +现在仓库的管理员和合作者可以将 Pull Requests 和 Issue 的评论功能关闭。 + +![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) + +这样,不是项目合作者的用户就不能在这个项目上使用评论功能。 + +![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) + +[*进一步了解对话锁定功能.*](https://github.com/blog/1847-locking-conversations) + +### 设置 CI 对每条 Pull Request 都进行构建 +如果配置正确,[Travis CI](https://travis-ci.org/) 会为每个你收到的 Pull Request 执行构建,就像每次提交也会触发构建一样。想了解更多关于 Travis CI 的信息,请参考 [Travis CI入门](http://docs.travis-ci.com/user/getting-started/)。 [![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) -[*进一步了解 Commit status API.*](https://github.com/blog/1227-commit-status-api) +[*进一步了解提交状态 API.*](https://github.com/blog/1227-commit-status-api) -### Markdown文件高亮语法 -例如,可以像下面这样在你的Markdown文件里为Ruby代码添加语法高亮: +### Markdown 文件语法高亮 +例如,可以像下面这样在你的 Markdown 文件里为 Ruby 代码添加语法高亮: ```ruby require 'tabbit' @@ -289,7 +297,7 @@ $ git commit -m "Fix screwup, fixes #12" puts table.to_s ``` -效果像下面这样: +效果如下: ```ruby require 'tabbit' @@ -304,7 +312,7 @@ Github使用 [Linguist](https://github.com/github/linguist) 做语言识别和 ### 表情符 -可以在Pull Requests, Issues, 提交消息, Markdown文件里加入表情符。使用方法`:name_of_emoji:` +可以在 Pull Requests, Issues, 提交消息, Markdown 文件里加入表情符。使用方法 `:name_of_emoji:` ``` :smile: @@ -313,9 +321,9 @@ Github使用 [Linguist](https://github.com/github/linguist) 做语言识别和 :smile: -Github支持的完整表情符号列表详见[emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 或 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)。 +Github 支持的完整表情符号列表详见[emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 或 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)。 -Github上使用最多的5个表情符号是: +Github 上使用最多的5个表情符号是: 1. `:shipit:` 2. `:sparkles:` @@ -323,14 +331,14 @@ Github上使用最多的5个表情符号是: 4. `:+1:` 5. `:clap:` -### 静态与动态图片 -注释和README等文件里也可以使用图片和GIF动画: +### 图片 / GIF 动画 +注释和README等文件里也可以使用图片和 GIF 动画: ``` ![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) ``` -仓库中的原始图片可以被直接调用: +仓库中的图片可以被直接引用: ``` ![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif) @@ -338,10 +346,10 @@ Github上使用最多的5个表情符号是: ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) -所有图片都缓存在Github,不用担心你的站点不能访问时就看不到图片了。 +所有图片都缓存在 Github,不用担心你的站点不能访问时就看不到图片了。 -#### 在GitHub Wiki中嵌入图片 -有多种方法可以在Wiki页面里嵌入图片。既可以像上一条里那样使用标准的Markdown语法,也可以像下面这样指定图片的高度或宽度: +#### 在 GitHub Wiki 中引用图片 +有多种方法可以在 Wiki 页面里嵌入图片。既可以像上一条里那样使用标准的 Markdown 语法,也可以像下面这样指定图片的高度或宽度: ```markdown [[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] @@ -351,27 +359,38 @@ Github上使用最多的5个表情符号是: ![Just a screenshot](http://i.imgur.com/J5bMf7S.png) ### 快速引用 -在主题评论中引用之前某个人所说的,只需选中文本,然后按 `r`键,想要的就会以引用的形式复制到你的输入框里。 +在主题评论中引用之前某个人所说的,只需选中文本,然后按 `r` 键,想要的就会以引用的形式复制到你的输入框里。 ![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) [*进一步了解快速引用.*](https://github.com/blog/1399-quick-quotes) -### 快速添加许可证 +### 粘贴剪贴板中的图片到评论 + +_(仅适用于 Chrome 浏览器)_ + +当截屏图片复制到剪贴板后(mac 上用 `cmd-ctrl-shift-4`),你可以用(`cmd-v / ctrl-v`)把图片粘贴到评论框里,然后它就会自动上传到 Github。 + +![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) + +[*进一步了解在 issue 中使用附件*](https://help.github.com/articles/issue-attachments) + + +### 快速添加许可证文件 创建一个仓库时,Github会为你提供一个预置的软件许可列表: ![License](http://i.imgur.com/Chqj4Fg.png) -对于已有的仓库,可以通过web界面创建文件来添加软件许可。输入`LICENSE`作为文件名后,同样可以从预置的列表中选择一个作为模板。 +对于已有的仓库,可以通过 web 界面创建文件来添加软件许可。输入`LICENSE`作为文件名后,同样可以从预置的列表中选择一个作为模板。 ![License](http://i.imgur.com/fTjQict.png) 这个技巧也适用于 `.gitignore` 文件。 -[*进一步了解 open source licensing.*](https://help.github.com/articles/open-source-licensing) +[*进一步了解开源许可证*](https://help.github.com/articles/open-source-licensing) ### 任务列表 -Issues和Pull requests里可以添加复选框,语法如下(注意空白符): +Issues 和 Pull requests 里可以添加复选框,语法如下(注意空白符): ``` - [ ] Be awesome @@ -384,7 +403,7 @@ Issues和Pull requests里可以添加复选框,语法如下(注意空白符 ![Task List](http://i.imgur.com/jJBXhsY.png) -当项目被选中时,它对应的Markdown源码也被更新了: +当项目被选中时,它对应的 Markdown 源码也被更新了: ``` - [x] Be awesome @@ -397,7 +416,7 @@ Issues和Pull requests里可以添加复选框,语法如下(注意空白符 [*进一步了解任务列表.*](https://help.github.com/articles/writing-on-github#task-lists) -####Markdown文件中的任务列表 +#### Markdown 文件中的任务列表 在完全适配Markdown语法的文件中可以使用以下语法加入一个**只读**的任务列表 @@ -420,7 +439,7 @@ Issues和Pull requests里可以添加复选框,语法如下(注意空白符 - [ ] Deimos - [ ] Phobos -[*进一步了解Markdown文件中的任务列表*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) +[*进一步了解 Markdown 文件中的任务列表*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) ### 相对链接 Markdown文件里链接到内部内容时推荐使用相对链接。 @@ -429,35 +448,36 @@ Markdown文件里链接到内部内容时推荐使用相对链接。 [Link to a header](#awesome-section) [Link to a file](docs/readme) ``` -绝对链接会在URL改变时(例如重命名仓库、用户名改变,建立分支项目)被更新。使用相对链接能够保证你的文档不受此影响。 +绝对链接会在 URL 改变时(例如重命名仓库、用户名改变,建立分支项目)被更新。使用相对链接能够保证你的文档不受此影响。 [*进一步了解相对链接.*](https://help.github.com/articles/relative-links-in-readmes) -### GitHub Pages的元数据与插件支持 -在Jekyll页面和文章里,仓库信息可在 `site.github` 命名空间下找到,也可以显示出来,例如,使用 `{{ site.github.project_title }}`显示项目标题。 +### GitHub Pages 的元数据与插件支持 +在 Jekyll 页面和文章里,仓库信息可在 `site.github` 命名空间下找到,也可以显示出来,例如,使用 `{{ site.github.project_title }}`显示项目标题。 -Jemoji和jekyll-mentions插件为你的Jekyll文章和页面增加了[emoji](#emojis)和[@mentions](https://github.com/blog/821)功能。 +Jemoji 和 jekyll-mentions 插件为你的 Jekyll 文章和页面增加了[emoji](#emojis)和[@mentions](https://github.com/blog/821)功能。 -[*了解更多 GitHub Pages的元数据和插件支持.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) +[*了解更多 GitHub Pages 的元数据和插件支持.*](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 格式的元数据 +许多博客站点,比如基于 [Jekyll](http://jekyllrb.com/)的[GitHub Pages](http://pages.github.com/) ,都依赖于一些文章头部的 YAML 格式的元数据。 Github 会将其渲染成一个水平表格,方便阅读。 ![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) -[*进一步了解 在文档里查看YAML元数据.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) +[*进一步了解 在文档里查看 YAML 元数据.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) ### 渲染表格数据 -GitHub支持将 `.csv` (逗号分隔)和`.tsv` (制表符分隔)格式的文件渲染成表格数据。 +GitHub 支持将 `.csv` (逗号分隔)和 `.tsv` (制表符分隔)格式的文件渲染成表格数据。 ![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) [*进一步了解渲染表格数据.*](https://github.com/blog/1601-see-your-csvs) -### 撤销Pull Request +### 撤销 Pull Request +合并一个 Pull Request 之后,你可能会反悔:要么是这次 Pull Request 没什么用处,要么是还不到合并的时候。 -可以通过Pull Request中的Revert按钮来撤销一个已合并的Pull Request中的commit。按下按钮后会自动生成一个进行逆向操作的Pull Request。 +此时可以通过 Pull Request 中的 Revert 按钮来撤销一个已合并的 Pull Request 中的 commit。按下按钮后将自动生成一个进行逆操作的 Pull Request。 ![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67) @@ -466,7 +486,7 @@ GitHub支持将 `.csv` (逗号分隔)和`.tsv` (制表符分隔)格式的文件 ### Diffs #### 可渲染文档的Diffs -提交和Pull Requests里包含有Github支持的可渲染文档(比如Markdown)会提供*source* 和 *rendered* 两个视图功能。 +Commit 和 Pull Request 里包含有 Github 支持的可渲染文档(比如 Markdown)会提供*source* 和 *rendered* 两个视图功能。 ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) @@ -476,22 +496,22 @@ GitHub支持将 `.csv` (逗号分隔)和`.tsv` (制表符分隔)格式的文件 [*进一步了解渲染纯文本视图Diffs.*](https://github.com/blog/1784-rendered-prose-diffs) -#### 可变化地图 -当你在GitHub上查看一个包含地理数据的提交或pull request时,Github 将以可视化的方式对比版本之间的差异。 +#### 可比较的地图数据 +当你在GitHub上查看一个包含地理数据的 commit 或 pull request时,Github 将以可视化的方式对比版本之间的差异。 [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) -[*进一步了解可比较地图.*](https://github.com/blog/1772-diffable-more-customizable-maps) +[*进一步了解可比较的地图数据.*](https://github.com/blog/1772-diffable-more-customizable-maps) -#### 在diff中折叠与扩展代码 -你可以通过点击diff边栏里的 *unfold* 按钮来多显示几行上下文。你可以一直点击 *unfold* 按钮直到显示了文件的全部内容。这个功能在所有GitHub产生的diff界面都可以使用。 +#### 在 Diff 中展开查看更多的上下文 +你可以通过点击 diff 边栏里的 *unfold* 按钮来多显示几行上下文。你可以一直点击 *unfold* 按钮直到显示了文件的全部内容。这个功能在所有 GitHub 的 diff 功能中都可以使用。 ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) -[*进一步了解扩展Diff上下文.*](https://github.com/blog/1705-expanding-context-in-diffs) +[*进一步了解展开 Diff 上下文.*](https://github.com/blog/1705-expanding-context-in-diffs) -#### 查看Pull Request的diff和patch -在Pull Request的URL后面加上 `.diff` 或 `.patch` 的扩展名就可以得到它的diff或patch文件,例如: +#### 获取 Pull Request 的 diff 或 patch 文件 +在 Pull Request 的 URL 后面加上 `.diff` 或 `.patch` 的扩展名就可以得到它的 diff 或 patch 文件,例如: ``` https://github.com/tiimgreen/github-cheat-sheet/pull/15 @@ -518,43 +538,50 @@ index 88fcf69..8614873 100644 (...) ``` -#### 渲染图像发生的变动 -GitHub可以显示包括PNG、JPG、GIF、PSD在内的多种图片格式并提供了几种方式来比较这些格式的图片文件版本间的不同。 +#### 显示图片以及比较图片 +GitHub 可以显示包括 PNG、JPG、GIF、PSD 在内的多种图片格式并提供了几种方式来比较这些格式的图片文件版本间的不同。 [![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https://github.com/blog/1845-psd-viewing-diffing) -[*查看更多关于渲染图像变动的内容*](https://help.github.com/articles/rendering-and-diffing-images) +[*查看更多关于图片显示和比较*](https://help.github.com/articles/rendering-and-diffing-images) ### Hub -[Hub](https://github.com/github/hub)是一个对Git进行了封装的命令行工具,可以帮助你更方便的使用Github。 +[Hub](https://github.com/github/hub) 是一个对 Git 进行了封装的命令行工具,可以帮助你更方便的使用 Github。 -这使得你可以像下面这样进行克隆: +例如可以像下面这样进行克隆: ```bash $ hub clone tiimgreen/toc ``` -[*查看更多Hub提供的超酷命令.*](https://github.com/github/hub#commands) +[*查看更多 Hub 提供的超酷命令.*](https://github.com/github/hub#commands) ### 贡献者指南 -在你的仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建Issue或Pull Request时会看到这个文件的链接。 +在你的仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建 Issue 或 Pull Request 时会看到这个文件的链接。 ![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) [*进一步了解贡献者指南.*](https://github.com/blog/1184-contributing-guidelines) -### 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/ | +### Octicons +GitHubs 图标库 (Octicons) 现已开源。 -#### GitHub讨论 -| Title | Link | +![Octicons](https://og.github.com/octicons/octicons@1200x630.png) + +[*进一步了解 GitHub 图标库*](https://octicons.github.com) + +### GitHub 资源 +| 内容 | 链接 | +| ----- | ---- | +| 探索 GitHub | https://github.com/explore | +| GitHub 博客 | https://github.com/blog | +| GitHub 帮助 | https://help.github.com/ | +| GitHub 培训 | http://training.github.com/ | +| GitHub 开发者 | https://developer.github.com/ | + +#### GitHub 相关演讲视频 +| 内容 | 链接 | | ----- | ---- | | 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 | @@ -563,7 +590,34 @@ $ hub clone tiimgreen/toc | More Git and GitHub Secrets | https://www.youtube.com/watch?v=p50xsL-iVgU | ## Git -### 前一个分支 +### 从工作区去除大量已删除文件 +当用 `/bin/rm` 命令删除了大量文件之后,你可以用下面一条命令从工作区和索引中去除这些文件,以免一个一个的删除: + +```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 +``` + +### 上一个分支 快速检出上一个分支: ```bash @@ -579,9 +633,9 @@ $ git checkout - [*进一步了解 Git 分支.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) -### Stripspace命令 +### 去除空白 -Git Stripspace命令可以: +Git Stripspace 命令可以: - 去掉行尾空白符 - 多个空行压缩成一行 @@ -595,22 +649,22 @@ $ git stripspace < README.md [*进一步了解 Git `stripspace` 命令.*](http://git-scm.com/docs/git-stripspace) -### 检出Pull Requests -Pull Request是一种GitHub上可以通过以下多种方式在本地被检索的特别分支: +### 检出 Pull Requests +对 Github 仓库来说,Pull Request 是种特殊分支, 可以通过以下多种方式取到本地: -检索某个分支并临时储存在本地的`FETCH_HEAD`中以便快速查看更改(diff)以及合并(merge): +取出某个特定的 Pull Request 并临时作为本地的 `FETCH_HEAD` 中以便进行快速查看更改( diff )以及合并( merge ): ```bash $ git fetch origin refs/pull/[PR-Number]/head ``` -通过refspec获取所有的Pull Request为本地分支: +通过 refspec 获取所有的 Pull Request 为本地分支: ```bash $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' ``` -或在仓库的`.git/config`中加入下列设置来自动获取远程仓库中的Pull Request +或在仓库的 `.git/config` 中加入下列设置来自动获取远程仓库中的 Pull Request ``` [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* @@ -624,32 +678,32 @@ $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` -对基于派生库的Pull Request,可以通过先`checkout`代表此Pull Request的远端分支再由此分支建立一个本地分支: +对基于派生库的 Pull Request,可以通过先 `checkout` 代表此 Pull Request 的远端分支再由此分支建立一个本地分支: ```bash $ git checkout pr/42 pr-42 ``` -操作多个仓库的时候,可以在Git中设置获取Pull Request的全局选项。 +操作多个仓库的时候,可以在 Git 中设置获取 Pull Request 的全局选项。 -``` - git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" +```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) +[*进一步了解如何本地检出 pull request.*](https://help.github.com/articles/checking-out-pull-requests-locally) -### 提交空改动 :trollface: +### 没有任何改动的提交 可以使用`--allow-empty`选项强制创建一个没有任何改动的提交: ```bash @@ -661,9 +715,11 @@ $ git commit -m "Big-ass commit" --allow-empty - 标记新的工作或一个新功能的开始。 - 记录对项目的跟代码无关的改动。 - 跟使用你仓库的其他人交流。 - - 作为仓库的第一次提交,因为第一次提交后不能被rebase: `git commit -m "init repo" --allow-empty`. + - 作为仓库的第一次提交,因为第一次提交后不能被 rebase: `git commit -m "init repo" --allow-empty`. + + ![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) -### 更直观的Git Status +### 美化 Git Status 在命令行输入如下命令: ```bash @@ -672,7 +728,7 @@ $ git status 可以看到: -![git status](http://i.imgur.com/o3PEHAA.png) +![git status](http://i.imgur.com/qjPyvXb.png) 加上`-sb`选项: @@ -682,11 +738,11 @@ $ git status -sb 这会得到: -![git status -sb](http://i.imgur.com/xNI1bT0.png) +![git status -sb](http://i.imgur.com/K0OY3nm.png) [*进一步了解 Git `status` 命令.*](http://git-scm.com/docs/git-status) -### 更直观的Git Log +### 美化 Git Log 输入如下命令: ```bash @@ -695,16 +751,16 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s 可以看到: -![git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative](http://i.imgur.com/R2z8l7c.png) +![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](http://i.imgur.com/58eOtkW.png) -这要归功于[Palesz](http://stackoverflow.com/users/88355/palesz)在stackoverflow的回答。 +这要归功于 [Palesz](http://stackoverflow.com/users/88355/palesz) 在 stackoverflow 的回答。 *这个命令可以被用作别名,详细做法见[这里](#git%E5%91%BD%E4%BB%A4%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%AB%E5%90%8D)。* [*进一步了解 Git `log` 命令.*](http://git-scm.com/docs/git-log) -### Git查询 -Git查询运行你在之前的所有提交信息里进行搜索,找到其中和搜索条件相匹配的最近的一条。 +### Git 查询 +Git 查询运行你在之前的所有提交信息里进行搜索,找到其中和搜索条件相匹配的最近的一条。 ```bash $ git show :/query @@ -738,8 +794,17 @@ $ git branch --no-merged [*进一步了解 Git `branch` 命令.*](http://git-scm.com/docs/git-branch) -### 使用网页查看本地仓库 -使用Git的 `instaweb` 可以立即在 `gitweb`中浏览你的工作仓库。这个命令是个简单的脚本,配置了`gitweb`和用来浏览本地仓库的Web服务器。*(译者注:默认需要lighttpd支持)* +### 修复有问题的提交以及自动合并 +如果上一个或多个提交包含了错误,可以在你修复问题后使用下列命令处理(假设要修复的提交版本是`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` 和用来浏览本地仓库的Web服务器。*(译者注:默认需要lighttpd支持)* ```bash $ git instaweb @@ -751,11 +816,11 @@ $ git instaweb [*进一步了解 Git `instaweb` 命令.*](http://git-scm.com/docs/git-instaweb) -### Git配置 -所有Git配置都保存在你的`.gitconfig` 文件中。 +### Git 配置 +所有 Git 配置都保存在你的 `.gitconfig` 文件中。 -#### Git命令自定义别名 -别名用来帮助你定义自己的git命令。比如你可以定义 `git a` 来运行 `git add --all`。 +#### Git 命令自定义别名 +别名用来帮助你定义自己的 git 命令。比如你可以定义 `git a` 来运行 `git add --all`。 要添加一个别名, 一种方法是打开 `~/.gitconfig` 文件并添加如下内容: @@ -828,8 +893,8 @@ $ git comit -m "Message" # in 0.1 seconds automatically... ``` -#### 带颜色输出 -要在你的Git命令输出里加上颜色的话,可以用如下命令: +#### 颜色输出 +要在你的 Git 命令输出里加上颜色的话,可以用如下命令: ```bash $ git config --global color.ui 1 @@ -837,7 +902,7 @@ $ git config --global color.ui 1 [*进一步了解 Git `config` 命令.*](http://git-scm.com/docs/git-config) -### Git资源 +### Git 资源 | Title | Link | | ----- | ---- | | Official Git Site | http://git-scm.com/ | @@ -852,7 +917,7 @@ $ git config --global color.ui 1 | Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | | Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | -#### Git参考书籍 +#### Git 参考书籍 | Title | Link | | ----- | ---- | | Pragmatic Version Control Using Git | http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git | From b44d3d44ffdde2c0522798ffe489dbb7faa87154 Mon Sep 17 00:00:00 2001 From: Yash Kshirsagar Date: Thu, 19 Feb 2015 16:13:07 -0800 Subject: [PATCH 213/292] add useful git resource --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 97029b7..1165b37 100644 --- a/README.md +++ b/README.md @@ -908,6 +908,7 @@ $ git config --global color.ui 1 | 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 | From d7a41953a393cf8d4b4beaead785640c404fa718 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Fri, 20 Feb 2015 12:54:15 +0900 Subject: [PATCH 214/292] Update Ko translation to 3c21657 --- README.ko.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/README.ko.md b/README.ko.md index 1eec567..b7f2b74 100644 --- a/README.ko.md +++ b/README.ko.md @@ -51,10 +51,11 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [Git](#git) + - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - [Previous Branch](#previous-branch) - [Stripspace](#stripspace) - [Checking out Pull Requests](#checking-out-pull-requests) - - [Empty Commits :trollface:](#empty-commits-trollface) + - [Empty Commits](#empty-commits) - [Styled Git Status](#styled-git-status) - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) @@ -324,7 +325,7 @@ puts table.to_s ### Emojis -에모지는 풀 리퀘스트, 이슈, 커밋 메세지등에 `:에모지의_이름:`으로 넣을 수 있습니다. +에모지는 풀 리퀘스트, 이슈, 커밋 메세지, 저장소 설명등에 `:에모지의_이름:`으로 넣을 수 있습니다. 깃허브에서 사용 가능한 에모지의 전 목록은 [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 나 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. @@ -615,6 +616,34 @@ $ hub clone tiimgreen/toc ## Git +### Remove All Deleted Files from the Working Tree + +`/bin/rm`을 사용해 대량의 파일을 지울 때, 하나씩 제거할 필요 없이 밑의 명령어를 사용해 작업 디렉터리와 인덱스에서 지울 수 있습니다. + +```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 +``` + ### Previous Branch 커맨드 라인에서 이전 디렉터리로 이동하려면 이렇게 합니다. @@ -714,7 +743,7 @@ git checkout pr/42 [*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally) -### Empty Commits :trollface: +### Empty Commits `--allow-empty`를 추가하시면 코드의 변경 없이 커밋을 넣을 수 있습니다. @@ -938,6 +967,7 @@ $ git config --global color.ui 1 | 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 From 02640dab7b53dac1f36c205fcd65ba54a92310ab Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Thu, 19 Feb 2015 19:43:46 +0900 Subject: [PATCH 215/292] Update Ja translation to 3c21657 --- README.ja.md | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/README.ja.md b/README.ja.md index 713d8f3..7b1d5c2 100644 --- a/README.ja.md +++ b/README.ja.md @@ -48,10 +48,11 @@ - [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%BB%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) - [pull requestのチェックアウト](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%A2%E3%82%A6%E3%83%88) - - [空のコミット :trollface:](#%E7%A9%BA%E3%81%AE%E3%82%B3%E3%83%9F%E3%83%83%E3%83%88-trollface) + - [空のコミット](#%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) @@ -304,7 +305,7 @@ GitHubでは[Linguist](https://github.com/github/linguist)を使って言語を [*GitHub Flavored Markdownについてもっと詳しく*](https://help.github.com/articles/github-flavored-markdown) ### Emoji -Emojiはpull requestやissue、READMEなどで`:name_of_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)で確認できる。 @@ -575,6 +576,33 @@ GitHubで使われているアイコン(Octicons)はオープンソース化 | 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で直前のブランチへ移動するには: @@ -660,7 +688,7 @@ git checkout pr/42 [*pull requestのチェックアウトについてもっと詳しく*](https://help.github.com/articles/checking-out-pull-requests-locally) -### 空のコミット :trollface: +### 空のコミット `--allow-empty`オプションを付けると、コードの変化がなくてもコミットを作成することができる: ```bash @@ -877,6 +905,7 @@ $ git config --global color.ui 1 | 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 | From 385c451c1c36776919d3181a140010d42372ff39 Mon Sep 17 00:00:00 2001 From: wolfg1969 Date: Tue, 24 Feb 2015 11:43:39 +0800 Subject: [PATCH 216/292] Update Zh translation to 11a9b62 --- README.zh-cn.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 8d83553..7d78eaa 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -85,8 +85,8 @@ Git 和 Github 秘籍,灵感来自于 [Zach Holman](https://github.com/holman) ![After, tab space example](http://i.imgur.com/70FL4H9.png) -### 查看某个用户的 Commit 历史 -在 Commits 页面 URL 后加上 `?author={user}` 查看某个用户的所有提交。 +### 查看用户的全部 Commit 历史 +在 Commits 页面 URL 后加上 `?author={user}` 查看用户全部的提交。 ``` https://github.com/rails/rails/commits/master?author=dhh @@ -179,7 +179,7 @@ https://github.com/rails/rails/compare/byroot:master...master ![Gist](http://i.imgur.com/VkKI1LC.png?1) -Gist 的 URL 后加上 `.pibb`,比如 [like this](https://gist.github.com/tiimgreen/10545817.pibb) ,方便嵌入到其他网站。 +Gist 的 URL 后加上 `.pibb`([像这样](https://gist.github.com/tiimgreen/10545817.pibb))可以得到便于嵌入到其他网站 的 HTML 代码。 Gists 可以像任何标准仓库一样被克隆。 @@ -558,7 +558,7 @@ $ hub clone tiimgreen/toc ### 贡献者指南 -在你的仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建 Issue 或 Pull Request 时会看到这个文件的链接。 +在仓库的根目录添加一个名为 `CONTRIBUTING` 的文件后,贡献者在新建 Issue 或 Pull Request 时会看到一个指向这个文件的链接。 ![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) @@ -916,6 +916,8 @@ $ git config --global color.ui 1 | Git for Designer | http://hoth.entp.com/output/git_for_designers.html | | 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 参考书籍 | Title | Link | From fb4a079afe4b9f2013b7639cf8c343d6dcaf83ff Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Fri, 13 Mar 2015 10:07:15 -0400 Subject: [PATCH 217/292] Add cheat for documented but not visible negative and merged filters. --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 1165b37..c3a2e6f 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Cross-Link Issues](#cross-link-issues) - [Locking Conversations](#locking-conversations) - [CI Status on Pull Requests](#ci-status-on-pull-requests) + - [Negative filters in Issues](#negative-filters-in-issues) + - [Merged pull requests filter](#merged-pull-requests-filter) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) @@ -284,6 +286,33 @@ If set up correctly, every time you receive a Pull Request, [Travis CI](https:// [*Read more about the commit status API.*](https://github.com/blog/1227-commit-status-api) +### Negative filters in Issues + +Both issues and pull requests allow filtering in the user interface. + +For the Rails repo: https://github.com/rails/rails/issues, the following filter is built by selecting the label "activerecord": + +`is:issue label:activerecord` + +But, you can also find all issues that are NOT labeled activerecord: + +`is:issue -label:activerecord` + +Additionally, this also works for pull requests: + +`is:pr -label:activerecord` + +[*Read more about searching issues.*](https://help.github.com/articles/searching-issues) + +### Merged pull requests filter + +Github has tabs for displaying open or closed issues and pull requests but you +can also see merged pull requests. Just put the following in the filter: + +`is:merged` + +[*Read more about searching issues.*](https://help.github.com/articles/searching-issues) + ### Syntax Highlighting in Markdown Files For example, to syntax highlight Ruby code in your Markdown files write: From e75f6c90b126ffda9589c97342dfbf6530586a56 Mon Sep 17 00:00:00 2001 From: Masaki Kobayashi Date: Mon, 23 Mar 2015 22:45:07 +0900 Subject: [PATCH 218/292] fix typo --- README.ja.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.ja.md b/README.ja.md index 7b1d5c2..30011c2 100644 --- a/README.ja.md +++ b/README.ja.md @@ -268,7 +268,7 @@ $ git commit -m "Fix screwup, fixes #12" ![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) -つまりそのプロジェクトの共同開発者ではユーザーはコメントをすることができないということだ。 +つまりそのプロジェクトの共同開発者ではないユーザーはコメントをすることができないということだ。 ![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) From bab1259a9549af87c0b95a5ca5beacd6a2149f24 Mon Sep 17 00:00:00 2001 From: Alex Efros Date: Fri, 1 May 2015 13:34:46 +0300 Subject: [PATCH 219/292] Fix date format in Comparing Branches This format is mentioned in https://help.github.com/articles/comparing-commits-across-time/#comparisons-across-time. Manual tests may be confusing because matched commits has date out of chosen range: this happens because github select commits using their merge date, not commit date. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1165b37..2dbc637 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` -*Dates are in the format `YYYY-DD-MM`* +*Dates are in the format `YYYY-MM-DD`* ![Another compare example](http://i.imgur.com/5dtzESz.png) From 9f3abb6daafae5a674dcade07338512d6d567a7c Mon Sep 17 00:00:00 2001 From: yang-wei Date: Sun, 3 May 2015 21:51:12 +0900 Subject: [PATCH 220/292] Add git grep --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 1165b37..8a614ea 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Styled Git Status](#styled-git-status) - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) + - [Git Grep](#git-grep) - [Merged Branches](#merged-branches) - [Fixup and Autosquash](#fixup-and-autosquash) - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) @@ -764,6 +765,32 @@ $ git show :/typo *Press `q` to quit.* + +### Git Grep +Grep pattern under your git versioned folder. + +Running: +``` +git grep aliases +``` +will show all the files containing the string *aliases*. + +![git grep aliases](http://i.imgur.com/q3WkUgl.png?1) + +*Press `q` to quit.* + +We can also use multiple flags for more advanced search. For example: + + * `-e` The next parameter is the pattern (including regex) + * `--and` Combine multiple patterns. + +Use it like this: +``` + git grep -e pattern --and -e anotherpattern +``` + +[*Read more about the Git `grep` command.*](http://git-scm.com/docs/git-grep) + ### Merged Branches Running: From 4038d09de14b71b6ddcfca8df3b97d0a69de0dad Mon Sep 17 00:00:00 2001 From: Tony Xue Date: Wed, 6 May 2015 10:52:51 +0800 Subject: [PATCH 221/292] fixes non-Eng versions for #126 --- README.ja.md | 2 +- README.ko.md | 2 +- README.zh-cn.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.ja.md b/README.ja.md index 30011c2..cb30dce 100644 --- a/README.ja.md +++ b/README.ja.md @@ -142,7 +142,7 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` -*日付の形式は`YYYY-DD-MM`だ。* +*日付の形式は`YYYY-MM-DD`だ。* ![Another compare example](http://i.imgur.com/5dtzESz.png) diff --git a/README.ko.md b/README.ko.md index b7f2b74..792bf71 100644 --- a/README.ko.md +++ b/README.ko.md @@ -153,7 +153,7 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` -*날짜는 `YYYY-DD-MM`형식으로 적습니다* +*날짜는 `YYYY-MM-DD`형식으로 적습니다* ![Another compare example](http://i.imgur.com/5dtzESz.png) diff --git a/README.zh-cn.md b/README.zh-cn.md index 7d78eaa..6f02490 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -144,7 +144,7 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` -*日期格式 `YYYY-DD-MM`* +*日期格式 `YYYY-MM-DD`* ![Another compare example](http://i.imgur.com/5dtzESz.png) From 67da27756284b95bd956413d21122b7c16eef3d1 Mon Sep 17 00:00:00 2001 From: Juanito Fatas Date: Wed, 6 May 2015 20:33:08 +0800 Subject: [PATCH 222/292] Add Rendering PDF --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2dbc637..ba37d82 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,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) + - [Rendering PDF](#rendering-pdf) - [Revert a Pull Request](#revert-a-pull-request) - [Diffs](#diffs) - [Rendered Prose Diffs](#rendered-prose-diffs) @@ -193,11 +194,11 @@ 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': +Username for 'https://gist.github.com': +Password for 'https://tiimgreen@gist.github.com': ``` -However, Gists do not support directories. All files need to be added to the repository root. +However, Gists do not support directories. All files need to be added to the repository root. [*Read more about creating Gists.*](https://help.github.com/articles/creating-gists) ### Git.io @@ -461,8 +462,16 @@ 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) +### Rendering PDF + +GitHub supports rendering PDF: + +![PDF](https://cloud.githubusercontent.com/assets/1000669/7492902/f8493160-f42e-11e4-8cea-1cb4f02757e7.png) + +[*Read more about rendering PDF.*](https://github.com/blog/1974-pdf-viewing) + ###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. +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. @@ -594,7 +603,7 @@ On branch master Changes not staged for commit: deleted: a deleted: c - + $ git rm $(git ls-files -d) rm 'a' rm 'c' From bd11217df8d1aa106ee0786411095ceca4ce328b Mon Sep 17 00:00:00 2001 From: metavige Date: Wed, 6 May 2015 21:12:40 +0800 Subject: [PATCH 223/292] add zh-tw locale --- README.zh-tw.md | 931 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 931 insertions(+) create mode 100644 README.zh-tw.md diff --git a/README.zh-tw.md b/README.zh-tw.md new file mode 100644 index 0000000..b8676dd --- /dev/null +++ b/README.zh-tw.md @@ -0,0 +1,931 @@ +# GitHub秘笈 +Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman) 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演講:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets)) 和 [More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 + +*其他語言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [簡體中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* + +# 目錄 + - [GitHub](#github) + - [不比較空白字串](#不比較空白字串) + - [調整 Tab 字串所代表的空格數](#調整-tab-字串所代表的空格數) + - [查看某個使用者的 Commit 歷史](#查看某個使用者的-commit-歷史) + - [倉庫複製](#倉庫複製) + - [分支](#分支) + - [將某個分支與其他所有分支進行比對](#將某個分支與其他所有分支進行比對) + - [比較分支](#比較分支) + - [比較不同派生庫的分支](#比較不同派生庫的分支) + - [Gists](#gists) + - [Git.io](#gitio) + - [鍵盤快捷鍵](#鍵盤快捷鍵) + - [整行高亮](#整行高亮) + - [用 Commit 訊息關閉 Issue](#用-commit-訊息關閉-issue) + - [連接其他倉庫的 Issue](#連接其他倉庫的-issue) + - [鎖定項目對話功能](#鎖定項目對話功能) + - [設置 CI 對每條 Pull Request 都進行構建](#設置-ci-對每條-pull-request-都進行構建) + - [Markdown 文件語法高亮](#markdown-文件語法高亮) + - [表情符號](#表情符號) + - [圖片 / GIF 動畫](#圖片--gif-動畫) + - [在 GitHub Wiki 中引用圖片](#在-github-wiki-中引用圖片) + - [快速引用](#快速引用) + - [複製貼上剪貼板中的圖片到評論](#複製貼上剪貼板中的圖片到評論) + - [快速添加許可證文件](#快速添加許可證文件) + - [任務列表](#任務列表) + - [Markdown 文件中的任務列表](#markdown-文件中的任務列表) + - [相對連接](#相對連接) + - [GitHub Pages 的中繼資料與插件支持](#github-pages-的中繼資料與插件支持) + - [查看 YAML 格式的中繼資料](#查看-yaml-格式的中繼資料) + - [渲染表格數據](#渲染表格數據) + - [撤銷 Pull Request](#撤銷-pull-request) + - [Diffs](#diffs) + - [可渲染文件的Diffs](#可渲染文件的diffs) + - [可比較的地圖數據](#可比較的地圖數據) + - [在 Diff 中展開查看更多的上下文](#在-diff-中展開查看更多的上下文) + - [獲取 Pull Request 的 diff 或 patch 文件](#獲取-pull-request-的-diff-或-patch-文件) + - [顯示圖片以及比較圖片](#顯示圖片以及比較圖片) + - [Hub](#hub) + - [貢獻者指南](#貢獻者指南) + - [Octicons](#octicons) + - [GitHub 資源](#github-資源) + - [GitHub 相關演講視頻](#github-相關演講視頻) + - [Git](#git) + - [從工作區去除大量已刪除文件](#從工作區去除大量已刪除文件) + - [上一個分支](#上一個分支) + - [去除空白](#去除空白) + - [檢出 Pull Requests](#檢出-pull-requests) + - [沒有任何改動的提交](#沒有任何改動的提交) + - [美化 Git Status](#美化-git-status) + - [美化 Git Log](#美化-git-log) + - [Git 查詢](#git-查詢) + - [合併分支](#合併分支) + - [修復有問題的提交以及自動合併](#修復有問題的提交以及自動合併) + - [以網站方式查看本地倉庫](#以網站方式查看本地倉庫) + - [Git 設置](#git-設置) + - [Git 命令自定義別名](#git-命令自定義別名) + - [自動更正](#自動更正) + - [顏色輸出](#顏色輸出) + - [Git 資源](#git-資源) + - [Git 參考書籍](#git-參考書籍) + +## GitHub +### 不比較空白字串 + +在任意 diff 頁面的 UR L後加上 `?w=1`,可以去掉那些隻是空白字串的改動,使你能更專註於代碼改動。 + +![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) + +[*詳見 GitHub secrets.*](https://github.com/blog/967-github-secrets) + +### 調整 Tab 字串所代表的空格數 +在 diff 或文件的 URL 後面加上 `?ts=4` ,這樣當顯示 tab 字串的長度時就會是 4 個空格的長度,不再是默認的 8 個空格。 `ts` 後面的數字還可以根據你個人的偏好進行修改。這個技巧不適用於 Gists,或者以 Raw 格式查看文件, 但有瀏覽器擴展插件可以幫你自動調整: [Chrome 擴展](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) , [Opera 擴展](https://addons.opera.com/en/extensions/details/github-tab-size/)。 + +下面以一個 Go 語言原始碼為例,看看在 URL 裡添加 `?ts=4` 參數的效果。添加前: + +![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) + +... 添加後的樣子: + +![After, tab space example](http://i.imgur.com/70FL4H9.png) + +### 查看使用者的全部 Commit 歷史 +在 Commits 頁面 URL 後加上 `?author={user}` 查看使用者全部的提交。 + +``` +https://github.com/rails/rails/commits/master?author=dhh +``` + +![DHH commit history](http://i.imgur.com/S7AE29b.png) + +[*深入了解提交視圖之間的區別*](https://help.github.com/articles/differences-between-commit-views) + +### 倉庫複製 +當複製倉庫時可以不要那個`.git`後綴。 + +```bash +$ git clone https://github.com/tiimgreen/github-cheat-sheet +``` + +[*更多對 Git `clone` 命令的介紹.*](http://git-scm.com/docs/git-clone) + +###分支 +####將某個分支與其他所有分支進行比對 + +當你查看某個倉庫的分支(Branches)頁面(緊挨著 Commits 連接)時 + +``` +https://github.com/{user}/{repo}/branches +``` +你會看到一個包含所有未合併的分支的列表。 + +在這裡你可以訪問分支比較頁面或刪除某個分支。 + +![Compare branches not merged into master in rails/rails repo - https://github.com/rails/rails/branches](http://i.imgur.com/0FEe30z.png) + +#### 比較分支 + +如果要在 GitHub 上直接比較兩個分支,可以使用如下形式的 URL : + +``` +https://github.com/{user}/{repo}/compare/{range} +``` + +其中 `{range} = master...4-1-stable` + +例如: + +``` +https://github.com/rails/rails/compare/master...4-1-stable +``` + +![Rails branch compare example](http://i.imgur.com/tIRCOsK.png) + +`{range}` 參數還可以使用下面的形式: + +``` +https://github.com/rails/rails/compare/master@{1.day.ago}...master +https://github.com/rails/rails/compare/master@{2014-10-04}...master +``` + +*日期格式 `YYYY-DD-MM`* + +![Another compare example](http://i.imgur.com/5dtzESz.png) + +在 `diff` 和 `patch` 頁面裡也可以比較分支: + +``` +https://github.com/rails/rails/compare/master...4-1-stable.diff +https://github.com/rails/rails/compare/master...4-1-stable.patch +``` + +[*了解更多關於基於時間的 Commit 比較.*](https://help.github.com/articles/comparing-commits-across-time) + +#### 比較不同派生庫的分支 + +想要對派生倉庫(Forked Repository)之間的分支進行比較,可以使用如下的 URL: + +``` +https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch} +``` + +例如: + +``` +https://github.com/rails/rails/compare/byroot:master...master +``` + +![Forked branch compare](http://i.imgur.com/Q1W6qcB.png) + +### Gists + +[Gists](https://gist.github.com/) 方便我們管理代碼片段,不必使用功能齊全的倉庫。 + +![Gist](http://i.imgur.com/VkKI1LC.png?1) + +Gist 的 URL 後加上 `.pibb`([像這樣](https://gist.github.com/tiimgreen/10545817.pibb))可以得到便於嵌入到其他網站 的 HTML 代碼。 + +Gists 可以像任何標準倉庫一樣被複製。 + +```bash +$ git clone https://gist.github.com/tiimgreen/10545817 +``` + +![Gists](http://i.imgur.com/BcFzabp.png) + +這意味著你可以像 Github 倉庫一樣修改和更新 Gists : + +```bash +$ git commit +$ git push +Username for 'https://gist.github.com': +Password for 'https://tiimgreen@gist.github.com': +``` + +但是, Gists 不支持目錄。所有文件都必須添加在倉庫的根目錄下。 +[*進一步了解如何建立 Gists.*](https://help.github.com/articles/creating-gists) + +### Git.io +[Git.io](http://git.io)是 Github 的短網址服務。 + +![Git.io](http://i.imgur.com/6JUfbcG.png?1) + +你可以通過 Curl 命令以普通 HTTP 協議使用它: + +```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` 鍵聚焦游標到當前倉庫的搜索框。此時按刪除鍵就會從搜索當前倉庫切換到搜索整個 Github 網站。 + - 按 `l` 鍵編輯 Issue 列表頁的標籤。 + - **查看文件內容時**(如:`https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`),按 `y` 鍵將會凍結這個頁面,這樣就算代碼被修改了也不會影響你當前看到的。 + +按`?`查看當前頁面支持的快捷鍵列表: + +![Keyboard shortcuts](http://i.imgur.com/y5ZfNEm.png) + +[*進一步了解可用的搜索語法.*](https://help.github.com/articles/search-syntax/) + +### 整行高亮 + +在代碼文件地址 URL 後加上`#L52`或者單擊行號 52 都會將第 52 行代碼高亮顯示。 + +多行高亮也可以,比如用`#L53-L60`選擇範圍,或者按住 `shift` 鍵,然後再點擊選擇的兩行。 + +``` +https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 +``` + +![整行高亮](http://i.imgur.com/8AhjrCz.png) + +### 用 Commit 訊息關閉 Issue + +如果某個提交修復了一個 Issue,當提交到 master 分支時,提交訊息裡可以使用 `fix/fixes/fixed`, `close/closes/closed` 或者 `resolve/resolves/resolved` 等關鍵詞,後面再跟上 Issue 號,這樣就會關閉這個 Issue 。 + +```bash +$ git commit -m "Fix screwup, fixes #12" +``` + +這將會關閉 Issue #12,並且在 Issue 討論列表裡關聯引用這次提交。 + +![Closing Repo](http://i.imgur.com/Uh1gZdx.png) + +[*進一步了解通過提交訊息關閉 Issue.*](https://help.github.com/articles/closing-issues-via-commit-messages) + +### 連接其他倉庫的 Issue +如果你想引用到同一個倉庫中的一個 Issue,隻需使用井號 `#` 加上 Issue 號,這樣就會自動建立到此 Issue 的連接。 + +要連接到其他倉庫的 Issue ,就使用`{user}/{repo}#ISSUE_NUMBER`的方式,例如`tiimgreen/toc#12`。 + +![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) + +### 鎖定項目對話功能 +現在倉庫的管理員和合作者可以將 Pull Requests 和 Issue 的評論功能關閉。 + +![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) + +這樣,不是項目合作者的使用者就不能在這個項目上使用評論功能。 + +![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) + +[*進一步了解對話鎖定功能.*](https://github.com/blog/1847-locking-conversations) + +### 設置 CI 對每條 Pull Request 都進行構建 +如果設置正確,[Travis CI](https://travis-ci.org/) 會為每個你收到的 Pull Request 執行構建,就像每次提交也會觸發構建一樣。想了解更多關於 Travis CI 的訊息,請參考 [Travis CI入門](http://docs.travis-ci.com/user/getting-started/)。 + +[![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) + +[*進一步了解提交狀態 API.*](https://github.com/blog/1227-commit-status-api) + +### 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) 做語言識別和語法高亮。你可以仔細閱讀 [languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml),了解有哪些可用的關鍵字。 + +[*進一步了解 GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) + +### 表情符號 + +可以在 Pull Requests, Issues, 提交消息, Markdown 文件裡加入表情符號。使用方法 `:name_of_emoji:` + +``` +:smile: +``` +將輸出一個笑臉: + +:smile: + +Github 支持的完整表情符號號列表詳見[emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 或 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)。 + +Github 上使用最多的5個表情符號號是: + +1. `:shipit:` +2. `:sparkles:` +3. `:-1:` +4. `:+1:` +5. `:clap:` + +### 圖片 / GIF 動畫 +註解和README等文件裡也可以使用圖片和 GIF 動畫: + +``` +![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) +``` + +倉庫中的圖片可以被直接引用: + +``` +![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif) +``` + +![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) + +所有圖片都緩存在 Github,不用擔心你的網站不能訪問時就看不到圖片了。 + +#### 在 GitHub Wiki 中引用圖片 +有多種方法可以在 Wiki 頁面裡嵌入圖片。既可以像上一條裡那樣使用標準的 Markdown 語法,也可以像下面這樣指定圖片的高度或寬度: + +```markdown +[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] +``` +結果: + +![Just a screenshot](http://i.imgur.com/J5bMf7S.png) + +### 快速引用 +在主題評論中引用之前某個人所說的,只需選中文件,然後按 `r` 鍵,想要的就會以引用的形式複製到你的輸入框裡。 + +![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) + +[*進一步了解快速引用.*](https://github.com/blog/1399-quick-quotes) + +### 複製貼上剪貼板中的圖片到評論 + +_(僅適用於 Chrome 瀏覽器)_ + +當截屏圖片複製到剪貼板後(mac 上用 `cmd-ctrl-shift-4`),你可以用(`cmd-v / ctrl-v`)把圖片複製貼上到評論框裡,然後它就會自動上傳到 Github。 + +![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) + +[*進一步了解在 issue 中使用附件*](https://help.github.com/articles/issue-attachments) + + +### 快速添加許可證文件 +建立一個倉庫時,Github會為你提供一個預設的軟體授權條款: + +![License](http://i.imgur.com/Chqj4Fg.png) + +對於已有的倉庫,可以通過 web 界面建立文件來添加軟體授權條款。輸入`LICENSE`作為文件名後,同樣可以從預設的列表中選擇一個作為模板。 + +![License](http://i.imgur.com/fTjQict.png) + +這個技巧也適用於 `.gitignore` 文件。 + +[*進一步了解開源許可證*](https://help.github.com/articles/open-source-licensing) + +### 任務列表 +Issues 和 Pull requests 裡可以添加複選框,語法如下(註意空白符): + +``` +- [ ] Be awesome +- [ ] Prepare dinner + - [ ] Research recipe + - [ ] Buy ingredients + - [ ] Cook recipe +- [ ] Sleep +``` + +![Task List](http://i.imgur.com/jJBXhsY.png) + +當項目被選中時,它對應的 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] Moon +- [x] Mars + - [ ] Deimos + - [ ] Phobos +``` + +- [ ] Mercury +- [x] Venus +- [x] Earth + - [x] Moon +- [x] Mars + - [ ] Deimos + - [ ] Phobos + +[*進一步了解 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 插件為你的 Jekyll 文章和頁面增加了[emoji](#emojis)和[@mentions](https://github.com/blog/821)功能。 + +[*了解更多 GitHub Pages 的中繼資料和插件支持.*](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 metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) + +[*進一步了解 在文件裡查看 YAML 中繼資料.*](https://github.com/blog/1647-viewing-yaml-metadata-in-your-documents) + +### 渲染表格數據 + +GitHub 支持將 `.csv` (逗號分隔)和 `.tsv` (定位點分隔)格式的文件渲染成表格數據。 + +![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) + +[*進一步了解渲染表格數據.*](https://github.com/blog/1601-see-your-csvs) + +### 撤銷 Pull Request +合併一個 Pull Request 之後,你可能會反悔:要麼是這次 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 + +Commit 和 Pull Request 裡包含有 Github 支持的可渲染文件(比如 Markdown)會提供*source* 和 *rendered* 兩個視圖功能。 + +![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) + +點擊 "rendered" 按鈕,看看改動在渲染後的顯示效果。當你添加、刪除或修改文件時,渲染純文件視圖非常方便。 + +![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) + +[*進一步了解渲染純文件視圖Diffs.*](https://github.com/blog/1784-rendered-prose-diffs) + +#### 可比較的地圖數據 +當你在GitHub上查看一個包含地理數據的 commit 或 pull request時,Github 將以可視化的方式比對版本之間的差異。 + +[![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) + +[*進一步了解可比較的地圖數據.*](https://github.com/blog/1772-diffable-more-customizable-maps) + +#### 在 Diff 中展開查看更多的上下文 +你可以通過點擊 diff 邊欄裡的 *unfold* 按鈕來多顯示幾行上下文。你可以一直點擊 *unfold* 按鈕直到顯示了文件的全部內容。這個功能在所有 GitHub 的 diff 功能中都可以使用。 + +![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) + +[*進一步了解展開 Diff 上下文.*](https://github.com/blog/1705-expanding-context-in-diffs) + +#### 獲取 Pull Request 的 diff 或 patch 文件 +在 Pull Request 的 URL 後面加上 `.diff` 或 `.patch` 的擴展名就可以得到它的 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 + +(...) +``` +#### 顯示圖片以及比較圖片 +GitHub 可以顯示包括 PNG、JPG、GIF、PSD 在內的多種圖片格式並提供了幾種方式來比較這些格式的圖片文件版本間的不同。 + +[![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https://github.com/blog/1845-psd-viewing-diffing) + +[*查看更多關於圖片顯示和比較*](https://help.github.com/articles/rendering-and-diffing-images) + +### Hub +[Hub](https://github.com/github/hub) 是一個對 Git 進行了封裝的命令行工具,可以幫助你更方便的使用 Github。 + +例如可以像下面這樣進行複製: + +```bash +$ hub clone tiimgreen/toc +``` + +[*查看更多 Hub 提供的超酷命令.*](https://github.com/github/hub#commands) + +### 貢獻者指南 + +在倉庫的根目錄添加一個名為 `CONTRIBUTING` 的文件後,貢獻者在新建 Issue 或 Pull Request 時會看到一個指向這個文件的連接。 + +![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) + +[*進一步了解貢獻者指南.*](https://github.com/blog/1184-contributing-guidelines) + +### Octicons +GitHubs 圖標庫 (Octicons) 現已開源。 + +![Octicons](https://og.github.com/octicons/octicons@1200x630.png) + +[*進一步了解 GitHub 圖標庫*](https://octicons.github.com) + +### GitHub 資源 +| 內容 | 連接 | +| ----- | ---- | +| 探索 GitHub | https://github.com/explore | +| GitHub 博客 | https://github.com/blog | +| GitHub 幫助 | https://help.github.com/ | +| GitHub 培訓 | http://training.github.com/ | +| GitHub 開發者 | https://developer.github.com/ | + +#### GitHub 相關演講視頻 +| 內容 | 連接 | +| ----- | ---- | +| 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` 命令刪除了大量文件之後,你可以用下面一條命令從工作區和索引中去除這些文件,以免一個一個的刪除: + +```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 +``` + +### 上一個分支 +快速檢出上一個分支: + +```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) + +### 檢出 Pull Requests +對 Github 倉庫來說,Pull Request 是種特殊分支, 可以通過以下多種方式取到本地: + +取出某個特定的 Pull Request 並臨時作為本地的 `FETCH_HEAD` 中以便進行快速查看更改( diff )以及合併( merge ): + +```bash +$ git fetch origin refs/pull/[PR-Number]/head +``` + +通過 refspec 獲取所有的 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,可以通過先 `checkout` 代表此 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 +``` + +這樣做在如下幾種情況下是有意義的: + + - 標記新的工作或一個新功能的開始。 + - 記錄對項目的跟代碼無關的改動。 + - 跟使用你倉庫的其他人交流。 + - 作為倉庫的第一次提交,因為第一次提交後不能被 rebase: `git commit -m "init repo" --allow-empty`. + + ![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) + +### 美化 Git Status +在命令行輸入如下命令: + +```bash +$ git status +``` + +可以看到: + +![git status](http://i.imgur.com/qjPyvXb.png) + +加上`-sb`選項: + +```bash +$ git status -sb +``` + +這會得到: + +![git status -sb](http://i.imgur.com/K0OY3nm.png) + +[*進一步了解 Git `status` 命令.*](http://git-scm.com/docs/git-status) + +### 美化 Git Log +輸入如下命令: + +```bash +$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative +``` + +可以看到: + +![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](http://i.imgur.com/58eOtkW.png) + +這要歸功於 [Palesz](http://stackoverflow.com/users/88355/palesz) 在 stackoverflow 的回答。 + +*這個命令可以被用作別名,詳細做法見[這裡](#git%E5%91%BD%E4%BB%A4%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%AB%E5%90%8D)。* + +[*進一步了解 Git `log` 命令.*](http://git-scm.com/docs/git-log) + +### Git 查詢 +Git 查詢運行你在之前的所有提交訊息裡進行搜索,找到其中和搜索條件相匹配的最近的一條。 + +```bash +$ git show :/query +``` + +這裡 `query` (區別大小寫)是你想要搜索的詞語, 這條命令會找到包含這個詞語的最後那個提交並顯示變動詳情。 + +```bash +$ git show :/typo +``` +![git show :/query](http://i.imgur.com/icaGiNt.png) + +* 按 `q` 鍵退出命令。* + +### 合併分支 +輸入命令: + +```bash +$ git branch --merged +``` + +這會顯示所有已經合併到你當前分支的分支列表。 + +相反地: + +```bash +$ git branch --no-merged +``` + +會顯示所有還沒有合併到你當前分支的分支列表。 + +[*進一步了解 Git `branch` 命令.*](http://git-scm.com/docs/git-branch) + +### 修復有問題的提交以及自動合併 +如果上一個或多個提交包含了錯誤,可以在你修復問題後使用下列命令處理(假設要修復的提交版本是`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` 和用來瀏覽本地倉庫的Web服務器。*(譯者註:默認需要lighttpd支持)* + +```bash +$ git instaweb +``` + +執行後打開: + +![Git instaweb](http://i.imgur.com/Dxekmqc.png) + +[*進一步了解 Git `instaweb` 命令.*](http://git-scm.com/docs/git-instaweb) + +### Git 設置 +所有 Git 設置都保存在你的 `.gitconfig` 文件中。 + +#### Git 命令自定義別名 +別名用來幫助你定義自己的 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' +``` + +下面列出了一些有用的別名: + +| 別名 Alias | 命令 Command | 如何設置 What to Type | +| --- | --- | --- | +| `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/ | +| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | +| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | +| 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 參考書籍 +| 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 Peepcode | http://peepcode.com/products/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 | \ No newline at end of file From c5dbb419c45be864671092ceea5fffc6e89877d5 Mon Sep 17 00:00:00 2001 From: metavige Date: Wed, 6 May 2015 21:37:30 +0800 Subject: [PATCH 224/292] add zh-tw link to other pages --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.ja.md b/README.ja.md index 30011c2..37ded11 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,7 +1,7 @@ # GitHubカンニング・ペーパー これは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))の二つのトークを元にしている。 -*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* # 目次 - [GitHub](#github) diff --git a/README.ko.md b/README.ko.md index b7f2b74..42fee83 100644 --- a/README.ko.md +++ b/README.ko.md @@ -4,7 +4,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c *Shortlink: [`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).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* # 목록 diff --git a/README.md b/README.md index 2dbc637..a35f4b2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c *Shortlink: [`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).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* ## Table of Contents - [GitHub](#github) diff --git a/README.zh-cn.md b/README.zh-cn.md index 7d78eaa..9d810c6 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -1,7 +1,7 @@ # GitHub秘籍 Git 和 Github 秘籍,灵感来自于 [Zach Holman](https://github.com/holman) 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演讲:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets)) 和 [More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 -*其他语言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md).* +*其他语言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* # 目录 - [GitHub](#github) From 4dbf5f0f3e9304c79024cca3816da028b1e81d0c Mon Sep 17 00:00:00 2001 From: metavige Date: Mon, 11 May 2015 23:05:56 +0800 Subject: [PATCH 225/292] =?UTF-8?q?change=20=E7=B9=81=E9=AB=94=E4=B8=AD?= =?UTF-8?q?=E6=96=87=20to=20=E6=AD=A3=E9=AB=94=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 2 +- README.zh-tw.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.ja.md b/README.ja.md index 37ded11..806ace2 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,7 +1,7 @@ # GitHubカンニング・ペーパー これは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))の二つのトークを元にしている。 -*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* # 目次 - [GitHub](#github) diff --git a/README.ko.md b/README.ko.md index 42fee83..25cc66f 100644 --- a/README.ko.md +++ b/README.ko.md @@ -4,7 +4,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c *Shortlink: [`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).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* # 목록 diff --git a/README.md b/README.md index a35f4b2..710d805 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c *Shortlink: [`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).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* ## Table of Contents - [GitHub](#github) diff --git a/README.zh-cn.md b/README.zh-cn.md index 9d810c6..47a012d 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -1,7 +1,7 @@ # GitHub秘籍 Git 和 Github 秘籍,灵感来自于 [Zach Holman](https://github.com/holman) 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演讲:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets)) 和 [More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 -*其他语言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* +*其他语言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* # 目录 - [GitHub](#github) diff --git a/README.zh-tw.md b/README.zh-tw.md index b8676dd..4622e31 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -1,7 +1,7 @@ # GitHub秘笈 Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman) 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演講:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets)) 和 [More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 -*其他語言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [簡體中文](README.zh-cn.md), [繁體中文](README.zh-tw.md).* +*其他語言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [簡體中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* # 目錄 - [GitHub](#github) From f903a663b0a9188d1b1ddad7b05868f6817e89a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 2 Jun 2015 16:59:17 +0200 Subject: [PATCH 226/292] Adding SSH key trick --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 710d805..545e0e0 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - [Previous Branch](#previous-branch) - [Stripspace](#stripspace) + - [SSH keys](#ssh-keys) - [Checking out Pull Requests](#checking-out-pull-requests) - [Empty Commits](#empty-commits) - [Styled Git Status](#styled-git-status) @@ -637,6 +638,18 @@ $ git stripspace < README.md [*Read more about the Git `stripspace` command.*](http://git-scm.com/docs/git-stripspace) +### SSH keys + +You can get a list of public ssh keys in plain text format by visiting: + +``` +https://github.com/{user}.keys +``` + +e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) + +[Read more about accessing public ssh keys...](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) + ### Checking out Pull Requests Pull Requests are special branches on the GitHub repository which can be retrieved locally in several ways: From 4678d44a49966857261ef68fdc4acee8f6b8bb5d Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 3 Jun 2015 21:00:16 +0100 Subject: [PATCH 227/292] Make text italic --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62c7cf6..9a04a69 100644 --- a/README.md +++ b/README.md @@ -657,7 +657,7 @@ https://github.com/{user}.keys e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) -[Read more about accessing public ssh keys...](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) +[*Read more about accessing public ssh keys.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) ### Checking out Pull Requests From 3aba3c0282fd5af512eb191bdc2cc0361906129e Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 3 Jun 2015 21:06:56 +0100 Subject: [PATCH 228/292] Update Git Grep section --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 32eb0c5..ed365d6 100644 --- a/README.md +++ b/README.md @@ -789,26 +789,27 @@ $ git show :/typo ### Git Grep -Grep pattern under your git versioned folder. + +Git Grep will return a list of lines matching a pattern. Running: -``` -git grep aliases +```bash +$ git grep aliases ``` will show all the files containing the string *aliases*. -![git grep aliases](http://i.imgur.com/q3WkUgl.png?1) +![git grep aliases](http://i.imgur.com/DL2zpQ9.png) *Press `q` to quit.* -We can also use multiple flags for more advanced search. For example: +You can also use multiple flags for more advanced search. For example: - * `-e` The next parameter is the pattern (including regex) - * `--and` Combine multiple patterns. + * `-e` The next parameter is the pattern (e.g. regex) + * `--and`, `--or` and `--not` Combine multiple patterns. Use it like this: -``` - git grep -e pattern --and -e anotherpattern +```bash + $ git grep -e pattern --and -e anotherpattern ``` [*Read more about the Git `grep` command.*](http://git-scm.com/docs/git-grep) From a336a366c5fdbccd9ff941e537c744cb8029fa76 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Thu, 4 Jun 2015 08:26:18 +0900 Subject: [PATCH 229/292] Update Ko translation to 3aba3c0 --- README.ko.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.ko.md b/README.ko.md index 890ec5d..e563eb4 100644 --- a/README.ko.md +++ b/README.ko.md @@ -38,6 +38,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) + - [Rendering PDF](#rendering-pdf) - [Revert a Pull Request](#revert-a-pull-request) - [Diffs](#diffs) - [Rendered Prose Diffs](#rendered-prose-diffs) @@ -54,11 +55,13 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - [Previous Branch](#previous-branch) - [Stripspace](#stripspace) + - [SSH keys](#ssh-keys) - [Checking out Pull Requests](#checking-out-pull-requests) - [Empty Commits](#empty-commits) - [Styled Git Status](#styled-git-status) - [Styled Git Log](#styled-git-log) - [Git Query](#git-query) + - [Git Grep](#git-grep) - [Merged Branches](#merged-branches) - [Fixup and Autosquash](#fixup-and-autosquash) - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) @@ -486,6 +489,14 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis [*표 데이타 표시에 대해 더 읽어 보세요.*](https://github.com/blog/1601-see-your-csvs) +### Rendering PDF + +깃허브에서 PDF를 렌더링할 수 있습니다. + +![PDF](https://cloud.githubusercontent.com/assets/1000669/7492902/f8493160-f42e-11e4-8cea-1cb4f02757e7.png) + +[*PDF 렌더링에 대해 더 읽어 보세요.*](https://github.com/blog/1974-pdf-viewing) + ### Revert a Pull Request 풀 리퀘스트가 머지된 후에, 아무 도움이 안되거나 머지가 잘못된 결정이었다는 걸 @@ -683,6 +694,18 @@ $ git stripspace < README.md [*깃 `stripspace` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-stripspace) +### SSH keys + +밑의 주소를 방문하면 공개 ssh 키의 목록을 일반 텍스트 형식으로 볼 수 있습니다. + +``` +https://github.com/{user}.keys +``` + +e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) + +[*공개 ssh 키 접근에 대해 더 읽어 보세요.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) + ### Checking out Pull Requests 풀 리퀘스트는 깃허브 저장소에서 사용하는 특별한 브랜치로 여러 방법으로 로컬로 @@ -814,6 +837,32 @@ $ git show :/typo NOTE: 나오려면 `q`를 누르세요. +### Git Grep + +Git Grep은 패턴에 매치하는 줄의 목록을 반환합니다. + +다음 명령을 실행해 보세요. +```bash +$ git grep aliases +``` +*aliases* 문자열이 포함된 모든 파일을 보여줍니다. + +![git grep aliases](http://i.imgur.com/DL2zpQ9.png) + +*나오려면 `q`를 누르세요.* + +여러 플레그를 이용해서 좀 더 복잡한 검색을 할 수 있습니다. 예를 들면, + + * `-e` 다음 파라미터는 패턴 (e.g. regex) + * `--and`, `--or`, `--not` 으로 여러 패턴을 조합 + +이렇게 사용할 수 있습니다. +```bash + $ git grep -e pattern --and -e anotherpattern +``` + +[*깃 `grep` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-grep) + ### Merged Branches ```bash From e3d97bb95caec8d7d3037cdb638b3660f6b696de Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 4 Jun 2015 11:11:22 -0400 Subject: [PATCH 230/292] Simpify filter headers. --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c3a2e6f..c01fb23 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Cross-Link Issues](#cross-link-issues) - [Locking Conversations](#locking-conversations) - [CI Status on Pull Requests](#ci-status-on-pull-requests) - - [Negative filters in Issues](#negative-filters-in-issues) - - [Merged pull requests filter](#merged-pull-requests-filter) + - [Filters](#filters) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) @@ -286,7 +285,7 @@ If set up correctly, every time you receive a Pull Request, [Travis CI](https:// [*Read more about the commit status API.*](https://github.com/blog/1227-commit-status-api) -### Negative filters in Issues +### Filters Both issues and pull requests allow filtering in the user interface. @@ -302,10 +301,6 @@ Additionally, this also works for pull requests: `is:pr -label:activerecord` -[*Read more about searching issues.*](https://help.github.com/articles/searching-issues) - -### Merged pull requests filter - Github has tabs for displaying open or closed issues and pull requests but you can also see merged pull requests. Just put the following in the filter: From ce796535704325303de75f3c0dd2ebc332a18c87 Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 4 Jun 2015 11:22:17 -0400 Subject: [PATCH 231/292] Add filter by status api documentation. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c01fb23..9018944 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,14 @@ can also see merged pull requests. Just put the following in the filter: [*Read more about searching issues.*](https://help.github.com/articles/searching-issues) +Finally, github now allows you to filter by the Status API's status. + +Pull requests with only successful statuses: + +`status:success` + +[*Read more about searching on the Status API.*](https://github.com/blog/2014-filter-pull-requests-by-status) + ### Syntax Highlighting in Markdown Files For example, to syntax highlight Ruby code in your Markdown files write: From cc644618b1772b4b503df152ed1146ddb0bc041e Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Thu, 4 Jun 2015 13:58:37 +0900 Subject: [PATCH 232/292] Update documentation - Fix typo - Remove obsolete ToC item - Add shorturl link --- README.ja.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.ja.md b/README.ja.md index 559b634..90024d5 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,6 +1,8 @@ # GitHubカンニング・ペーパー これは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).* # 目次 @@ -42,7 +44,6 @@ - [pull requestの内容をDIFFまたはPATCH形式で取得](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) - - [共同開発者との摩擦の軽減](#%E5%85%B1%E5%90%8C%E9%96%8B%E7%99%BA%E8%80%85%E3%81%A8%E3%81%AE%E6%91%A9%E6%93%A6%E3%81%AE%E8%BB%BD%E6%B8%9B) - [開発参加のガイドライン](#%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) @@ -452,7 +453,7 @@ GitHubでは`.csv`(カンマ区切り)と`.tsv`(タブ区切り)の形 ![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) -[*表形式のデーター表示についてもっと詳しく*](https://github.com/blog/1601-see-your-csvs) +[*表形式のデータ表示についてもっと詳しく*](https://github.com/blog/1601-see-your-csvs) ### pull requestの取り消し pull requestをマージした後、意味がなかったことがわかったり、そのpull requestをマージしたのは間違いだったことがわかることもあるだろう。 From 28f244733a7da16525ad326fc5955099e11011a7 Mon Sep 17 00:00:00 2001 From: Kyo Nagashima Date: Thu, 4 Jun 2015 13:57:18 +0900 Subject: [PATCH 233/292] Update Ja translation to 96f050f --- README.ja.md | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/README.ja.md b/README.ja.md index 90024d5..1ed850c 100644 --- a/README.ja.md +++ b/README.ja.md @@ -23,6 +23,7 @@ - [issueの相互リンク](#%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%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結果の表示](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) @@ -36,6 +37,7 @@ - [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) @@ -52,11 +54,13 @@ - [すべての削除済みファイルをワーキング・ツリーから削除する](#%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%BB%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のチェックアウト](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) @@ -282,6 +286,35 @@ $ git commit -m "Fix screwup, fixes #12" [*コミット・ステータス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のコードを構文強調したいならば以下のようにする: @@ -455,6 +488,13 @@ GitHubでは`.csv`(カンマ区切り)と`.tsv`(タブ区切り)の形 [*表形式のデータ表示についてもっと詳しく*](https://github.com/blog/1601-see-your-csvs) +### PDF表示 +GitHubではPDFの表示をサポートしている: + +![PDF](https://cloud.githubusercontent.com/assets/1000669/7492902/f8493160-f42e-11e4-8cea-1cb4f02757e7.png) + +[*PDF表示についてもっと詳しく*](https://github.com/blog/1974-pdf-viewing) + ### pull requestの取り消し pull requestをマージした後、意味がなかったことがわかったり、そのpull requestをマージしたのは間違いだったことがわかることもあるだろう。 @@ -592,7 +632,7 @@ On branch master Changes not staged for commit: deleted: a deleted: c - + $ git rm $(git ls-files -d) rm 'a' rm 'c' @@ -635,6 +675,17 @@ $ 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のリポジトリでは特別なブランチであり、様々な方法でローカルに取り込むことができる: @@ -761,6 +812,34 @@ $ git show :/typo 注: 終了するには`q`を押す。 +### Git Grep +Git Grepは指定したパターンに一致する行の一覧を返してくれる。 + +実行すると: + +```bash +$ git grep aliases +``` + +*aliases*という文字を含むファイルを全て表示することだろう。 + +![git grep aliases](http://i.imgur.com/DL2zpQ9.png) + +注: 終了するには`q`を押す。 + +複数のフラグを組み合わせることで、より高度な検索を行うことができる。例えば: + + * `-e` 次のパラメーターをパターンとする (例: regex) + * `--and`、`--or`と`--not` 複数のパターンを組み合わせる + +以下のようにして使う: + +```bash +$ git grep -e pattern --and -e anotherpattern +``` + +[*Gitの`grep`コマンドについてもっと詳しく*](http://git-scm.com/docs/git-grep) + ### マージ済みブランチ 以下のように実行すると: From 22d02fa41e374b4b4082489c9395532f8bfa8b08 Mon Sep 17 00:00:00 2001 From: Ken Sato Date: Mon, 8 Jun 2015 22:23:48 +0900 Subject: [PATCH 234/292] fix relative links --- README.ja.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.ja.md b/README.ja.md index 1ed850c..67e4458 100644 --- a/README.ja.md +++ b/README.ja.md @@ -11,7 +11,7 @@ - [タブ幅の調節](#%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) + - [ブランチ](#%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) @@ -19,10 +19,10 @@ - [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%89%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%82%92%E9%96%89%E3%81%98%E3%82%8B) - - [issueの相互リンク](#%E3%82%A4%E3%82%B7%E3%83%A5%E3%83%BC%E3%81%AE%E7%9B%B8%E4%BA%92%E3%83%AA%E3%83%B3%E3%82%AF) + - [コミットから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結果の表示](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%A7%E3%81%AEci%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA) + - [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) @@ -38,12 +38,12 @@ - [文書内の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) + - [pull requestの取り消し](#ull+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) - [マップ差分の可視化](#%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形式で取得](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%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) + - [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) @@ -54,8 +54,8 @@ - [すべての削除済みファイルをワーキング・ツリーから削除する](#%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%BB%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のチェックアウト](#%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%82%A8%E3%82%B9%E3%83%88%E3%81%AE%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%A2%E3%82%A6%E3%83%88) + - [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) From 956e661c0d35627df982c5ad3bf0afd3cd059053 Mon Sep 17 00:00:00 2001 From: Ken Sato Date: Mon, 8 Jun 2015 22:43:40 +0900 Subject: [PATCH 235/292] fix more links --- README.ja.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.ja.md b/README.ja.md index 67e4458..897ea31 100644 --- a/README.ja.md +++ b/README.ja.md @@ -22,7 +22,7 @@ - [コミットから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) + - [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) @@ -38,9 +38,9 @@ - [文書内の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の取り消し](#ull+request%E3%81%AE%E5%8F%96%E3%82%8A%E6%B6%88%E3%81%97) + - [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) + - [レンダリング済みの差分表示](#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) @@ -55,7 +55,7 @@ - [直前のブランチ](#%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) + - [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) @@ -598,7 +598,7 @@ GitHubで使われているアイコン(Octicons)はオープンソース化 [*GitHubのOcticonsについてもっと詳しく*](https://octicons.github.com) -### GitHub Resources +### GitHub情報 | Title | Link | | ----- | ---- | | GitHub Explore | https://github.com/explore | @@ -970,7 +970,7 @@ $ git config --global color.ui 1 [*Gitの`config`コマンドについてもっと詳しく*](http://git-scm.com/docs/git-config) -### Git Resources +### Git情報 | Title | Link | | ----- | ---- | | Official Git Site | http://git-scm.com/ | From 58613be77cfa58e49f2d2bc593dbf5ad3107bda4 Mon Sep 17 00:00:00 2001 From: Ivan Goldsmith Date: Mon, 8 Jun 2015 14:44:06 -0400 Subject: [PATCH 236/292] Add link to emoji finder. :link: --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 119facd..d237bfe 100644 --- a/README.md +++ b/README.md @@ -346,6 +346,7 @@ GitHub uses [Linguist](https://github.com/github/linguist) to perform language d Emojis can be added to Pull Requests, Issues, commit messages, repository descriptions, etc. using `:name_of_emoji:`. 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). +A handy emoji search engine can be found at [emoji.muan.co](http://emoji.muan.co/). The top 5 used Emojis on GitHub are: From bfd27223f488bc1df2ff1914730da29ef4d44b3f Mon Sep 17 00:00:00 2001 From: Ivan Goldsmith Date: Mon, 8 Jun 2015 14:52:10 -0400 Subject: [PATCH 237/292] =?UTF-8?q?Add=20emoji=20search=20link=20(?= =?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E).=20:link:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.ja.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.ja.md b/README.ja.md index 1ed850c..8d34002 100644 --- a/README.ja.md +++ b/README.ja.md @@ -342,6 +342,7 @@ GitHubでは[Linguist](https://github.com/github/linguist)を使って言語を 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は以下の通りだ: From 5b43916717d1afa9c5dfa8a41a1d462aae70e3f8 Mon Sep 17 00:00:00 2001 From: Ken Sato Date: Tue, 9 Jun 2015 19:54:37 +0900 Subject: [PATCH 238/292] make more fixes --- README.ja.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.ja.md b/README.ja.md index 897ea31..86ddef7 100644 --- a/README.ja.md +++ b/README.ja.md @@ -40,10 +40,10 @@ - [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%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) + - [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) @@ -51,11 +51,11 @@ - [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%BB%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) + - [すべての削除済みファイルをワーキング・ツリーから削除する](#%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) + - [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) From a0c03c7d50dcaef1161791ca40aee19045f08c41 Mon Sep 17 00:00:00 2001 From: Robin Glauser Date: Sat, 11 Jul 2015 11:16:37 +0200 Subject: [PATCH 239/292] Adding education.github.com to github resource list. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d237bfe..a7ad82c 100644 --- a/README.md +++ b/README.md @@ -612,6 +612,7 @@ GitHubs icons (Octicons) have now been open sourced. | GitHub Help | https://help.github.com/ | | GitHub Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | +| Github Education (Free Micro Account and other stuff for students) | https://education.github.com/ | #### GitHub Talks | Title | Link | From 8a7dd3435bd7ee30c96e9b13e8269472ec1399b7 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 5 Aug 2015 22:19:57 +0100 Subject: [PATCH 240/292] Awesome badge --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 8 ++++---- README.zh-tw.md | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.ja.md b/README.ja.md index 211fe04..a4accd3 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,4 +1,4 @@ -# GitHubカンニング・ペーパー +# GitHubカンニング・ペーパー [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](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)* diff --git a/README.ko.md b/README.ko.md index e563eb4..250b09e 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,4 +1,4 @@ -# 깃허브 치트 시트 +# 깃허브 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) A collection of cool hidden and not so 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)). diff --git a/README.md b/README.md index a7ad82c..091dd0a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# GitHub Cheat Sheet +# GitHub Cheat Sheet [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) A collection of cool hidden and not so 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)). *Shortlink: [`http://git.io/sheet`](http://git.io/sheet)* diff --git a/README.zh-cn.md b/README.zh-cn.md index 07fc837..d93427d 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -1,4 +1,4 @@ -# GitHub秘籍 +# GitHub秘籍 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) Git 和 Github 秘籍,灵感来自于 [Zach Holman](https://github.com/holman) 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演讲:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets)) 和 [More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 *其他语言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* @@ -189,7 +189,7 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/BcFzabp.png) -这意味着你可以像 Github 仓库一样修改和更新 Gists : +这意味着你可以像 Github 仓库一样修改和更新 Gists : ```bash $ git commit @@ -605,7 +605,7 @@ On branch master Changes not staged for commit: deleted: a deleted: c - + $ git rm $(git ls-files -d) rm 'a' rm 'c' @@ -782,7 +782,7 @@ $ git show :/typo $ git branch --merged ``` -这会显示所有已经合并到你当前分支的分支列表。 +这会显示所有已经合并到你当前分支的分支列表。 相反地: diff --git a/README.zh-tw.md b/README.zh-tw.md index 4622e31..817f0d6 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -1,4 +1,4 @@ -# GitHub秘笈 +# GitHub秘笈 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman) 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演講:[Git and GitHub Secrets](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([slides](https://speakerdeck.com/holman/git-and-github-secrets)) 和 [More Git and GitHub Secrets](https://vimeo.com/72955426)([slides](https://speakerdeck.com/holman/more-git-and-github-secrets))。 *其他語言版本: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [簡體中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* @@ -189,7 +189,7 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/BcFzabp.png) -這意味著你可以像 Github 倉庫一樣修改和更新 Gists : +這意味著你可以像 Github 倉庫一樣修改和更新 Gists : ```bash $ git commit @@ -605,7 +605,7 @@ On branch master Changes not staged for commit: deleted: a deleted: c - + $ git rm $(git ls-files -d) rm 'a' rm 'c' @@ -782,7 +782,7 @@ $ git show :/typo $ git branch --merged ``` -這會顯示所有已經合併到你當前分支的分支列表。 +這會顯示所有已經合併到你當前分支的分支列表。 相反地: @@ -928,4 +928,4 @@ $ git config --global color.ui 1 | 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 | \ No newline at end of file +| Git: Version Control for Everyone | http://www.packtpub.com/git-version-control-for-everyone/book | From aaa758cbccaa37f4f40b2f7eec67afda89769107 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 25 Sep 2015 09:07:30 +0800 Subject: [PATCH 241/292] Add ssh keys and git grep section. Signed-off-by: Bo-Yi Wu --- README.zh-tw.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/README.zh-tw.md b/README.zh-tw.md index 817f0d6..9b7ba9a 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -50,11 +50,13 @@ Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman) - [從工作區去除大量已刪除文件](#從工作區去除大量已刪除文件) - [上一個分支](#上一個分支) - [去除空白](#去除空白) + - [SSH 金鑰](#ssh-金鑰) - [檢出 Pull Requests](#檢出-pull-requests) - [沒有任何改動的提交](#沒有任何改動的提交) - [美化 Git Status](#美化-git-status) - [美化 Git Log](#美化-git-log) - [Git 查詢](#git-查詢) + - [Git Grep](#git-grep) - [合併分支](#合併分支) - [修復有問題的提交以及自動合併](#修復有問題的提交以及自動合併) - [以網站方式查看本地倉庫](#以網站方式查看本地倉庫) @@ -649,7 +651,21 @@ $ git stripspace < README.md [*進一步了解 Git `stripspace` 命令.*](http://git-scm.com/docs/git-stripspace) +### SSH 金鑰 + +您可以藉由下面網址得到全部公開的 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 Requests + 對 Github 倉庫來說,Pull Request 是種特殊分支, 可以通過以下多種方式取到本地: 取出某個特定的 Pull Request 並臨時作為本地的 `FETCH_HEAD` 中以便進行快速查看更改( diff )以及合併( merge ): @@ -775,7 +791,35 @@ $ git show :/typo * 按 `q` 鍵退出命令。* +### Git Grep + +Git Grep 將顯示匹配字串的行號。 + +執行: + +```bash +$ git grep aliases +``` +會找出檔案內有出現 *aliases* 字串。 + +![git grep aliases](http://i.imgur.com/DL2zpQ9.png) + +* 按 `q` 結束搜尋* + +你也可以使用多重 flags 來達到進階搜尋。範例: + + * `-e` 下一個搜尋匹配條件 (e.g. regex) + * `--and`, `--or` and `--not` 合併多重匹配字串. + +使用如下: +```bash + $ git grep -e pattern --and -e anotherpattern +``` + +[*更多詳細 Git `grep` 指令介紹*](http://git-scm.com/docs/git-grep) + ### 合併分支 + 輸入命令: ```bash From a383289d0e6515881f8ea23f324c4c4d2001bbe4 Mon Sep 17 00:00:00 2001 From: CHANN Date: Thu, 24 Dec 2015 00:14:09 +0900 Subject: [PATCH 242/292] Update README.ko.md --- README.ko.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.ko.md b/README.ko.md index 250b09e..60b002c 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,10 +1,10 @@ -# 깃허브 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) +# Github 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) -A collection of cool hidden and not so 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)). +Git과 Github에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)의 ([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))와 WDCNZ 2013에서 발표한 [Git과 Github에 대한 더 많은 비밀들](https://vimeo.com/72955426)의 ([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. -*Shortlink: [`http://git.io/sheet`](http://git.io/sheet)* +*단축주소: [`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).* +*다른 언어로 보기: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* # 목록 From 18fb974afe132ceefd2f450e2a36cd27b0c8d647 Mon Sep 17 00:00:00 2001 From: CHANN Date: Thu, 24 Dec 2015 21:38:44 +0900 Subject: [PATCH 243/292] Fix #145: undo the "Read this in other languages" --- README.ko.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index 60b002c..fb4adc4 100644 --- a/README.ko.md +++ b/README.ko.md @@ -4,7 +4,7 @@ Git과 Github에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다 *단축주소: [`http://git.io/sheet`](http://git.io/sheet)* -*다른 언어로 보기: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* +*Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* # 목록 From 0fa1774a8214320cb308c8cab86f1d801398e436 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Fri, 25 Dec 2015 08:19:15 +0900 Subject: [PATCH 244/292] Update Korean translation to ac2d48f --- README.ko.md | 77 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/README.ko.md b/README.ko.md index fb4adc4..fae4643 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,6 +1,6 @@ -# Github 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) +# GitHub 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) -Git과 Github에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)의 ([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))와 WDCNZ 2013에서 발표한 [Git과 Github에 대한 더 많은 비밀들](https://vimeo.com/72955426)의 ([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. +Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)의 ([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))와 WDCNZ 2013에서 발표한 [Git과 GitHub에 대한 더 많은 비밀들](https://vimeo.com/72955426)의 ([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. *단축주소: [`http://git.io/sheet`](http://git.io/sheet)* @@ -25,6 +25,7 @@ Git과 Github에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다 - [Cross-Link Issues](#cross-link-issues) - [Locking Conversations](#locking-conversations) - [CI Status on Pull Requests](#ci-status-on-pull-requests) + - [Filters](#filters) - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - [Emojis](#emojis) - [Images/GIFs](#imagesgifs) @@ -80,7 +81,7 @@ Git과 Github에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다 ![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) -[*깃허브의 비밀을 더 읽어 보세요.*](https://github.com/blog/967-github-secrets) +[*GitHub의 비밀을 더 읽어 보세요.*](https://github.com/blog/967-github-secrets) ### Adjust Tab Space @@ -133,7 +134,7 @@ https://github.com/{user}/{repo}/branches #### Comparing Branches -깃허브에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세요. +GitHub에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세요. ``` https://github.com/{user}/{repo}/compare/{range} @@ -214,7 +215,7 @@ Password for 'https://tiimgreen@gist.github.com': ### Git.io -[Git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. +[Git.io](http://git.io)는 GitHub를 위한 간단한 URL 단축기입니다. ![Git.io](http://i.imgur.com/6JUfbcG.png?1) @@ -302,6 +303,38 @@ $ git commit -m "Fix screwup, fixes #12" [*커밋 상태 API에 대해 좀 더 읽어보세요.*](https://github.com/blog/1227-commit-status-api) +### Filters + +이슈, 풀 리퀘스트 둘 다 유저 인터페이스에서 필터링이 가능합니다. + +레일즈 저장소 에서, 다음 필터는 +"activerecord" 라벨을 선택하여 만들어 집니다. + +`is:issue label:activerecord` + +하지만, activerecord 라벨이 없는 모든 이슈를 찾을 수도 있습니다. + +`is:issue -label:activerecord` + +덧붙여, 풀 리퀘스트에도 동작합니다. + +`is:pr -label:activerecord` + +GitHub는 열리거나 닫힌 이슈와 풀리퀘스트를 위한 탭이 있습니다만 머지된 +풀리퀘스트도 볼 수 있습니다. 다음 필터를 입력하기만 하면 됩니다. + +`is:merged` + +[*이슈 검색에 대해 좀 더 읽어보세요.*](https://help.github.com/articles/searching-issues) + +마지막으로 이제 상태 API의 상태에 의한 필터도 가능해졌습니다. + +성공 상태의 풀 리퀘스트는 이렇게 검색합니다. + +`status:success` + +[*상태 API 검색에 대해 좀 더 읽어보세요.*](https://github.com/blog/2014-filter-pull-requests-by-status) + ### Syntax Highlighting in Markdown Files 마크다운에서 예를 들어, 루비 코드를 신텍스 하이라이트 하려면 이렇게 합니다. @@ -322,17 +355,18 @@ table.add_row('Tim Green', 'tiimgreen@gmail.com') puts table.to_s ``` -깃허브는 [Linguist](https://github.com/github/linguist)를 사용해 언어를 감지하고 신텍스를 하이라이트합니다. [언어 YAML 파일](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)을 정독하시면 어떤 키워드가 유효한지 확인하실 수 있습니다. +GitHub는 [Linguist](https://github.com/github/linguist)를 사용해 언어를 감지하고 신텍스를 하이라이트합니다. [언어 YAML 파일](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)을 정독하시면 어떤 키워드가 유효한지 확인하실 수 있습니다. -[*깃허브 Flavored 마크다운에 대해 더 읽어 보세요.*](https://help.github.com/articles/github-flavored-markdown) +[*GitHub Flavored 마크다운에 대해 더 읽어 보세요.*](https://help.github.com/articles/github-flavored-markdown) ### Emojis 에모지는 풀 리퀘스트, 이슈, 커밋 메세지, 저장소 설명등에 `:에모지의_이름:`으로 넣을 수 있습니다. -깃허브에서 사용 가능한 에모지의 전 목록은 [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 나 [scotch-io/All-Github-Emoji-Icons](https://github.com/scotch-io/All-Github-Emoji-Icons)에서 확인하실 수 있습니다. +GitHub에서 사용 가능한 에모지의 전 목록은 [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 나 [scotch-io/All-GitHub-Emoji-Icons](https://github.com/scotch-io/All-GitHub-Emoji-Icons)에서 확인하실 수 있습니다. +편리한 에모지 검색 엔진은 [emoji.muan.co](http://emoji.muan.co/)에 있습니다. -깃허브에서 많이 사용하는 에모지 탑 5위는 이렇습니다. +GitHub에서 많이 사용하는 에모지 탑 5위는 이렇습니다. 1. `:shipit:` 2. `:sparkles:` @@ -382,7 +416,7 @@ puts table.to_s _(크롬에서만 동작합니다)_ -스크린샷을 찍고 클립보드에 있는 경우 (mac: `cmd-ctrl-shift-4`), 간단히 이미지를 커맨트 색션에 붙여넣기(`cmd-v / ctrl-v`)할 수 있고 이는 자동으로 깃허브에 업로드 됩니다. +스크린샷을 찍고 클립보드에 있는 경우 (mac: `cmd-ctrl-shift-4`), 간단히 이미지를 커맨트 색션에 붙여넣기(`cmd-v / ctrl-v`)할 수 있고 이는 자동으로 GitHub에 업로드 됩니다. ![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) @@ -390,7 +424,7 @@ _(크롬에서만 동작합니다)_ ### Quick Licensing -저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. +저장소를 만들 때, GitHub는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다. ![License](http://i.imgur.com/Chqj4Fg.png) @@ -471,11 +505,11 @@ _(크롬에서만 동작합니다)_ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis)와 [@mentions](https://github.com/blog/821)을 지킬 포스트와 페이지에서 사용하게 합니다. -[*저장소 메타 데이타와 깃허브 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) +[*저장소 메타 데이타와 GitHub 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) ### Viewing YAML Metadata in your Documents -[Jekyll](http://jekyllrb.com/)이나 [GitHub Pages](http://pages.github.com/)같은 많은 블로그에서 포스트의 처음에 YAML 포멧의 메타데이터를 필요로 합니다. 깃허브는 이 메타 정보를 읽기 편하게 테이블로 표시해 줍니다. +[Jekyll](http://jekyllrb.com/)이나 [GitHub Pages](http://pages.github.com/)같은 많은 블로그에서 포스트의 처음에 YAML 포멧의 메타데이터를 필요로 합니다. GitHub는 이 메타 정보를 읽기 편하게 테이블로 표시해 줍니다. ![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) @@ -483,7 +517,7 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis ### Rendering Tabular Data -깃허브는 `.csv` (comma-separated) 와 `.tsv` (tab-separated)파일에 대해 표(tabular) 데이터 보기를 지원합니다. +GitHub는 `.csv` (comma-separated) 와 `.tsv` (tab-separated)파일에 대해 표(tabular) 데이터 보기를 지원합니다. ![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) @@ -491,7 +525,7 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis ### Rendering PDF -깃허브에서 PDF를 렌더링할 수 있습니다. +GitHub에서 PDF를 렌더링할 수 있습니다. ![PDF](https://cloud.githubusercontent.com/assets/1000669/7492902/f8493160-f42e-11e4-8cea-1cb4f02757e7.png) @@ -523,7 +557,7 @@ GitHub에서 지원하는 산문(prose) 파일(예를 들어 Markdown)이 있는 #### Diffable Maps -지오데이타가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 깃허브는 무엇이 변경 되었는지 시각적으로 보여줍니다. +지오데이타가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 GitHub는 무엇이 변경 되었는지 시각적으로 보여줍니다. [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) @@ -531,7 +565,7 @@ GitHub에서 지원하는 산문(prose) 파일(예를 들어 Markdown)이 있는 #### Expanding Context in Diffs -diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 있습니다. 전채 파일을 표시할때까지 계속 *펼칠* 수 있으며, 깃허브에서 diff가 표시되는 장소라면 어디서든 사용가능합니다. +diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 있습니다. 전채 파일을 표시할때까지 계속 *펼칠* 수 있으며, GitHub에서 diff가 표시되는 장소라면 어디서든 사용가능합니다. ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) @@ -571,7 +605,7 @@ index 88fcf69..8614873 100644 #### Rendering and diffing images -깃허브는 PNG, JPG, GIF, PSD를 포함한 여러 일반 적인 이미지 형식을 표시할 수 있습니다. 추가적으로 이미지 형식의 diff를 표시하는 여러 방법을 제공합니다. +GitHub는 PNG, JPG, GIF, PSD를 포함한 여러 일반 적인 이미지 형식을 표시할 수 있습니다. 추가적으로 이미지 형식의 diff를 표시하는 여러 방법을 제공합니다. [![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https://github.com/blog/1845-psd-viewing-diffing @@ -579,7 +613,7 @@ index 88fcf69..8614873 100644 ### Hub -[Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. +[Hub](https://github.com/github/hub)는 GitHub를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. 이렇게 할 수 있습니다. @@ -599,7 +633,7 @@ $ hub clone tiimgreen/toc ### Octicons -깃허브 아이콘(옥티콘)이 이제 오픈소스가 되었습니다. +GitHub 아이콘(옥티콘)이 이제 오픈소스가 되었습니다. ![Octicons](https://og.github.com/octicons/octicons@1200x630.png) @@ -614,6 +648,7 @@ $ hub clone tiimgreen/toc | GitHub Help | https://help.github.com/ | | GitHub Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | +| GitHub Education (Free Micro Account and other stuff for students) | https://education.github.com/ | #### GitHub Talks @@ -708,7 +743,7 @@ e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) ### Checking out Pull Requests -풀 리퀘스트는 깃허브 저장소에서 사용하는 특별한 브랜치로 여러 방법으로 로컬로 +풀 리퀘스트는 GitHub 저장소에서 사용하는 특별한 브랜치로 여러 방법으로 로컬로 가져 올수 있습니다. 빠르게 `diff`나 `merge`를 하기위해 특정 풀 리퀘스트를 임시로 `FETCH_HEAD`로 From 8980611ab7c35f0252fa96092d1c81bd625ceadb Mon Sep 17 00:00:00 2001 From: Robert Anthony Bellamy Date: Tue, 29 Dec 2015 10:01:53 -0500 Subject: [PATCH 245/292] adds Learn Git Branching --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 091dd0a..d1d4a7a 100644 --- a/README.md +++ b/README.md @@ -993,6 +993,7 @@ $ git config --global color.ui 1 | 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 | +| Learn Git Branching | http://pcottle.github.io/learnGitBranching/ | #### Git Books | Title | Link | From da37f97c40c5ac562f94c975cb4770264270966e Mon Sep 17 00:00:00 2001 From: Robert Anthony Bellamy Date: Tue, 29 Dec 2015 10:10:29 -0500 Subject: [PATCH 246/292] adds some videos --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index d1d4a7a..f2f7074 100644 --- a/README.md +++ b/README.md @@ -1005,3 +1005,12 @@ $ git config --global color.ui 1 | 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 | + +#### Git Videos +| Title | Link | +| ----- | ---- | +| Linus Torvalds on Git | https://www.youtube.com/watch?v=4XpnKHJAok8 | +| Introduction to Git with Scott Chacon | https://www.youtube.com/watch?v=ZDR433b0HJY | +| Git From the Bits Up | https://www.youtube.com/watch?v=MYP56QJpDr4 | +| Graphs, Hashes, and Compression, Oh My! | https://www.youtube.com/watch?v=ig5E8CcdM9g | +| GitHub Training & Guides | https://www.youtube.com/watch?list=PLg7s6cbtAD15G8lNyoaYDuKZSKyJrgwB-&v=FyfwLX4HAxM | From 473d3c6bc1dc475540d2eff8b67ebfd6fc6bbdce Mon Sep 17 00:00:00 2001 From: Robert Anthony Bellamy Date: Tue, 29 Dec 2015 10:18:44 -0500 Subject: [PATCH 247/292] adds .gitignore templates --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f2f7074..3d61c90 100644 --- a/README.md +++ b/README.md @@ -994,6 +994,7 @@ $ git config --global color.ui 1 | GitHub Training Kit | http://training.github.com/kit | | Git Visualization Playground | http://onlywei.github.io/explain-git-with-d3/#freeplay | | Learn Git Branching | http://pcottle.github.io/learnGitBranching/ | +| A collection of useful .gitignore templates | https://github.com/github/gitignore | #### Git Books | Title | Link | From a2cfa260ba2a4850c4473c59f9516329a44160e5 Mon Sep 17 00:00:00 2001 From: Robert Anthony Bellamy Date: Tue, 29 Dec 2015 10:25:42 -0500 Subject: [PATCH 248/292] adds article section and updates menu --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3d61c90..2371220 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Color](#color) - [Git Resources](#git-resources) - [Git Books](#git-books) + - [Git Videos](#git-videos) + - [Git Articles](#git-articles) ## GitHub ### Ignore Whitespace @@ -1015,3 +1017,8 @@ $ git config --global color.ui 1 | Git From the Bits Up | https://www.youtube.com/watch?v=MYP56QJpDr4 | | Graphs, Hashes, and Compression, Oh My! | https://www.youtube.com/watch?v=ig5E8CcdM9g | | GitHub Training & Guides | https://www.youtube.com/watch?list=PLg7s6cbtAD15G8lNyoaYDuKZSKyJrgwB-&v=FyfwLX4HAxM | + +#### Git Articles +| Title | Link | +| ----- | ---- | +| GitHub Flow | http://scottchacon.com/2011/08/31/github-flow.html | From 21e084d6dc6b1ca636a9dd47c482905f6cb8b700 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 30 Dec 2015 01:54:34 +0000 Subject: [PATCH 249/292] Fix link issues as highlighted in #144 --- README.md | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 2371220..4a46559 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # GitHub Cheat Sheet [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) -A collection of cool hidden and not so 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)). +A collection of cool hidden and not so 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.http://confreaks.tv/videos/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)). *Shortlink: [`http://git.io/sheet`](http://git.io/sheet)* @@ -82,7 +82,7 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli [*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) ### Adjust Tab Space -Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) or [Opera extension](https://addons.opera.com/en/extensions/details/github-tab-size/) can automate this. +Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome](https://chrome.google.com/webstore/detail/tab-size-on-github/ofjbgncegkdemndciafljngjbdpfmbkn) or [Opera extension](https://addons.opera.com/en/extensions/details/github-tab-size/) can automate this. Here is a Go source file before adding `?ts=4`: @@ -101,7 +101,7 @@ https://github.com/rails/rails/commits/master?author=dhh ![DHH commit history](http://i.imgur.com/S7AE29b.png) -[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views) +[*Read more about the differences between commits views.*](https://help.github.com/articles/differences-between-commit-views/) ### Cloning a Repository When cloning a repository the `.git` can be left off the end. @@ -162,7 +162,7 @@ https://github.com/rails/rails/compare/master...4-1-stable.diff https://github.com/rails/rails/compare/master...4-1-stable.patch ``` -[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time) +[*Read more about comparing commits across time.*](https://help.github.com/articles/comparing-commits-across-time/) #### Compare Branches across Forked Repositories To use GitHub to compare branches across forked repositories, change the URL to look like this: @@ -204,7 +204,7 @@ Password for 'https://tiimgreen@gist.github.com': ``` However, Gists do not support directories. All files need to be added to the repository root. -[*Read more about creating Gists.*](https://help.github.com/articles/creating-gists) +[*Read more about creating Gists.*](https://help.github.com/articles/creating-gists/) ### Git.io [Git.io](http://git.io) is a simple URL shortener for GitHub. @@ -262,7 +262,7 @@ This closes the issue and references the closing commit. ![Closing Repo](http://i.imgur.com/Uh1gZdx.png) -[*Read more about closing Issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages) +[*Read more about closing Issues via commit messages.*](https://help.github.com/articles/closing-issues-via-commit-messages/) ### Cross-Link Issues If you want to link to another issue in the same repository, simply type hash `#` then the issue number, and it will be auto-linked. @@ -311,7 +311,7 @@ can also see merged pull requests. Just put the following in the filter: `is:merged` -[*Read more about searching issues.*](https://help.github.com/articles/searching-issues) +[*Read more about searching issues.*](https://help.github.com/articles/searching-issues/) Finally, github now allows you to filter by the Status API's status. @@ -342,7 +342,7 @@ puts table.to_s GitHub uses [Linguist](https://github.com/github/linguist) to perform language detection and syntax highlighting. You can find out which keywords are valid by perusing the [languages YAML file](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml). -[*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown) +[*Read more about GitHub Flavored Markdown.*](https://help.github.com/articles/github-flavored-markdown/) ### Emojis Emojis can be added to Pull Requests, Issues, commit messages, repository descriptions, etc. using `:name_of_emoji:`. @@ -401,7 +401,7 @@ After taking a screenshot and adding it to the clipboard (mac: `cmd-ctrl-shift-4 ![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) -[*Read more about issue attachments.*](https://help.github.com/articles/issue-attachments) +[*Read more about issue attachments.*](https://help.github.com/articles/issue-attachments/) ### Quick Licensing When creating a repository, GitHub gives you the option of adding in a pre-made license: @@ -414,7 +414,7 @@ You can also add them to existing repositories by creating a new file through th Also works for `.gitignore`. -[*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing) +[*Read more about open source licensing.*](https://help.github.com/articles/open-source-licensing/) ### Task Lists In Issues and Pull requests check boxes can be added with the following syntax (notice the space): @@ -441,7 +441,7 @@ When they are clicked, they will be updated in the pure Markdown: - [ ] Sleep ``` -[*Read more about task lists.*](https://help.github.com/articles/writing-on-github#task-lists) +[*Read more about task lists.*](https://help.github.com/articles/writing-on-github/#task-lists) #### Task Lists in Markdown Documents In full Markdown documents **read-only** checklists can now be added using the following syntax: @@ -476,7 +476,7 @@ Relative links are recommended in your Markdown files when linking to internal c Absolute links have to be updated whenever the URL changes (e.g. repository renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own. -[*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes) +[*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes/) ### Metadata and Plugin Support for GitHub Pages Within Jekyll pages and posts, repository information is available within the `site.github` namespace, and can be displayed, for example, using `{{ site.github.project_title }}`. @@ -486,7 +486,7 @@ The Jemoji and jekyll-mentions plugins enable [emoji](#emojis) and [@mentions](h [*Read more about repository metadata and plugin support for GitHub Pages.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) ### Viewing YAML Metadata in your Documents -Many blogging websites, like [Jekyll](http://jekyllrb.com/) with [GitHub Pages](http://pages.github.com/), depend on some YAML-formatted metadata at the beginning of your post. GitHub will render this metadata as a horizontal table, for easier reading +Many blogging websites, like [Jekyll](http://jekyllrb.com/) with [GitHub Pages](https://pages.github.com), depend on some YAML-formatted metadata at the beginning of your post. GitHub will render this metadata as a horizontal table, for easier reading ![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) @@ -578,7 +578,7 @@ GitHub can display several common image formats, including PNG, JPG, GIF, and PS [![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https://github.com/blog/1845-psd-viewing-diffing) -[*Read more about rendering and diffing images.*](https://help.github.com/articles/rendering-and-diffing-images) +[*Read more about rendering and diffing images.*](https://help.github.com/articles/rendering-and-diffing-images/) ### Hub [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. @@ -749,7 +749,7 @@ git fetch origin git checkout pr/42 ``` -[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally) +[*Read more about checking out pull requests locally.*](https://help.github.com/articles/checking-out-pull-requests-locally/) ### Empty Commits Commits can be pushed with no code changes by adding `--allow-empty`: @@ -989,11 +989,10 @@ $ git config --global color.ui 1 | Official Git Tutorial | http://git-scm.com/docs/gittutorial | | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | -| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designers | http://hoth.entp.com/output/git_for_designers.html | +| Ry's Git Tutorial | http://rypress.com/tutorials/git/index | | 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 | +| GitHub Training Kit | https://training.github.com/kit/ | | Git Visualization Playground | http://onlywei.github.io/explain-git-with-d3/#freeplay | | Learn Git Branching | http://pcottle.github.io/learnGitBranching/ | | A collection of useful .gitignore templates | https://github.com/github/gitignore | @@ -1001,13 +1000,13 @@ $ git config --global color.ui 1 #### Git Books | Title | Link | | ----- | ---- | -| Pragmatic Version Control Using Git | http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git | +| Pragmatic Version Control Using Git | https://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/ | +| Git in the Trenches | http://cbx33.github.io/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 | +| Pragmatic Guide to Git | https://pragprog.com/titles/pg_git/pragmatic-guide-to-git | +| Git: Version Control for Everyone | https://www.packtpub.com/application-development/git-version-control-everyone | #### Git Videos | Title | Link | From b9e8cfc198d9f2662ab07aebfd94a49ac14b02e8 Mon Sep 17 00:00:00 2001 From: Chayoung You Date: Wed, 30 Dec 2015 22:54:35 +0900 Subject: [PATCH 250/292] Update Korean translation to 21e084d See 21e084d6dc6b1ca636a9dd47c482905f6cb8b700. --- README.ko.md | 242 ++++++++++++++++++++++++++++----------------------- 1 file changed, 131 insertions(+), 111 deletions(-) diff --git a/README.ko.md b/README.ko.md index fae4643..1dac197 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,6 +1,6 @@ # GitHub 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) -Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)의 ([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))와 WDCNZ 2013에서 발표한 [Git과 GitHub에 대한 더 많은 비밀들](https://vimeo.com/72955426)의 ([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. +Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))과 WDCNZ 2013에서 발표한 [Git과 GitHub에 대한 더 많은 비밀들](https://vimeo.com/72955426)([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. *단축주소: [`http://git.io/sheet`](http://git.io/sheet)* @@ -85,14 +85,14 @@ Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다 ### Adjust Tab Space -diff나 파일 URL에 `?ts=4`를 덧붙이면 텝 문자의 크기를 기본값인 8대신 4공백으로 보여줍니다. `ts`뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw파일 보기에는 적용 되지 않습니다만, [크롬 익스텐션](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)이나 [오페라 익스텐션](https://addons.opera.com/en/extensions/details/github-tab-size/)으로 자동화 할 수 있습니다. +diff나 파일 URL에 `?ts=4`를 덧붙이면 탭 문자의 크기를 기본값인 공백 8개 대신 4개로 보여줍니다. `ts` 뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw 파일 보기에는 적용 되지 않습니다만, [크롬 확장 프로그램](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)이나 [오페라 확장 프로그램](https://addons.opera.com/en/extensions/details/github-tab-size/)으로 자동화 할 수 있습니다. 여기에 있는 Go 소스 파일은 `?ts=4`를 붙이기 전에는 이렇습니다. ![Before, tab space example](http://i.imgur.com/GIT1Fr0.png) 그리고 `?ts=4`를 붙인 다음에는 이렇게 됩니다. - --allow-empty + ![After, tab space example](http://i.imgur.com/70FL4H9.png) ### Commit History by Author @@ -115,9 +115,10 @@ https://github.com/rails/rails/commits/master?author=dhh $ git clone https://github.com/tiimgreen/github-cheat-sheet ``` -[*깃 `clone` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-clone) +[*Git `clone` 명령에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-clone) + +### Branch -###Branch #### Compare all Branches to Another Branch 저장소의 [브랜치](https://github.com/tiimgreen/github-cheat-sheet/branches) 페이지는, 커밋 버튼의 뒤에 있습니다. @@ -128,7 +129,7 @@ https://github.com/{user}/{repo}/branches ... 메인 브랜치에 머지되지 않은 모든 브랜치의 리스트를 볼 수 있습니다. -여기에서 버튼 클릭으로 비교 페이지나 브랜치 삭제를 하실 수 있습니다. +여기에서 버튼 클릭으로 비교 페이지에 접속하거나 브랜치를 삭제할 수 있습니다. ![Compare branches not merged into master in rails/rails repo - https://github.com/rails/rails/branches](http://i.imgur.com/0FEe30z.png) @@ -140,7 +141,7 @@ GitHub에서 브랜치 비교를 하시려면, URL을 이런 식으로 바꾸세 https://github.com/{user}/{repo}/compare/{range} ``` -`{range}`는 `master...4-1-stable`식으로 적습니다. +`{range}`는 `master...4-1-stable`과 같이 적습니다. 예를 들어 @@ -150,18 +151,18 @@ https://github.com/rails/rails/compare/master...4-1-stable ![Rails branch compare example](http://i.imgur.com/tIRCOsK.png) -`{range}` 는 이렇게 적을 수도 있습니다. +`{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`형식으로 적습니다* +*날짜는 `YYYY-MM-DD` 형식으로 적습니다* ![Another compare example](http://i.imgur.com/5dtzESz.png) -브랜치는 `diff`나 `patch`뷰로도 확인할 수 있습니다. +브랜치는 `diff`나 `patch` 뷰로도 확인할 수 있습니다. ``` https://github.com/rails/rails/compare/master...4-1-stable.diff @@ -172,7 +173,7 @@ https://github.com/rails/rails/compare/master...4-1-stable.patch #### Compare branches across forked repositories -포크된 저장소간의 브랜치를 비교하려면 URL을 이렇게 변경하세요. +포크된 저장소 간의 브랜치를 비교하려면 URL을 이렇게 변경하세요. ``` https://github.com/{user}/{repo}/compare/{foreign-user}:{branch}...{own-branch} @@ -188,13 +189,13 @@ https://github.com/rails/rails/compare/byroot:idempotent-counter-caches...master ### Gists -[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. +[Gist](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. ![Gist](http://i.imgur.com/VkKI1LC.png?1) -[이렇게](https://gist.github.com/tiimgreen/10545817.pibb) Gist URL뒤에 `.pibb`를 넣으면 다른 사이트에 넣을수 있는 *HTML 온리* 버전을 만들 수 있습니다. +[이렇게](https://gist.github.com/tiimgreen/10545817.pibb) Gist URL 뒤에 `.pibb`를 넣으면 다른 사이트에 첨부할 수 있는 *HTML 온리* 버전을 만들 수 있습니다. -Gists는 저장소처럼 취급할 수 있고 클론도 됩니다. +Gist는 저장소처럼 취급할 수 있고 클론도 됩니다. ```bash $ git clone https://gist.github.com/tiimgreen/10545817 @@ -202,15 +203,16 @@ $ git clone https://gist.github.com/tiimgreen/10545817 ![Gists](http://i.imgur.com/BcFzabp.png) -이는 Gists에서도 수정하고 업데이트를 푸쉬할 수 있다는 의미입니다. +이는 Gists에서도 수정하고 업데이트를 푸시할 수 있다는 의미입니다. ```bash $ git commit +$ git push Username for 'https://gist.github.com': Password for 'https://tiimgreen@gist.github.com': ``` -하지만, Gists는 디랙토리를 지원하지 않습니다. 모든 파일은 저장소의 루트에 넣을 필요가 있습니다. +하지만, Gists는 디렉터리를 지원하지 않습니다. 모든 파일은 저장소의 루트에 넣을 필요가 있습니다. [*Gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists) ### Git.io @@ -219,7 +221,7 @@ Password for 'https://tiimgreen@gist.github.com': ![Git.io](http://i.imgur.com/6JUfbcG.png?1) -순수 HTTP에서 Curl으로 사용하실 수도 있습니다. +Curl으로 순수 HTTP를 통해 사용하실 수도 있습니다. ```bash $ curl -i http://git.io -F "url=https://github.com/..." @@ -238,9 +240,9 @@ Location: https://github.com/... 저장소 페이지에서 단축키를 사용하면 쉽게 이동할 수 있습니다. - `t`를 누르면 파일 탐색 페이지로 이동합니다. - - `w`를 누르면 브렌치 선택 페이지로 이동합니다. - - `s`를 누르면 지금 저장소의 검색창이 포커스됩니다. 백스페이스를 누르면 채워져 있는 "This repository"를 지워 GitHub전체에서 검색할 수 있게 됩니다. - - `l`를 누르면 있는 이슈의 라벨을 수정할 수 있습니다. + - `w`를 누르면 브랜치 선택 페이지로 이동합니다. + - `s`를 누르면 현재 저장소의 검색창으로 포커스가 이동합니다. 백스페이스를 누르면 채워져 있는 "This repository"를 지워 GitHub 전체에서 검색할 수 있게 됩니다. + - `l`을 누르면 이슈의 라벨을 수정할 수 있습니다. - __파일을 보고 있을 때__ (예를 들어 `https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md`) `y`를 누르면 URL을 지금 보고 있는 페이지를 사실상 고정하도록 합니다. 코드가 바뀐다고 해도 이번에 본 내용을 다시 볼 수 있습니다. 지금 페이지에서 쓸 수 있는 모든 단축키를 보시려면 `?`를 누르세요. @@ -253,7 +255,7 @@ Location: https://github.com/... 코드 파일 URL의 끝에 `#L52`를 추가하거나 줄 번호를 클릭하면 그 줄 번호를 하이라이트합니다. -`#L53-L60`처럼 범위지정도 가능합니다. 범위를 지정하려면 `shift`키를 누른 채 두 라인을 클릭하면 됩니다. +`#L53-L60`처럼 범위 지정도 가능합니다. 범위를 지정하려면 `shift`키를 누른 채 두 라인을 클릭하면 됩니다. ``` https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 @@ -269,15 +271,15 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L $ git commit -m "Fix screwup, fixes #12" ``` -이렇게 하면 이슈를 닫고 클로징 커맨트로 참조하게 합니다. +이렇게 하면 이슈를 닫고 클로징 커밋으로 참조하게 합니다. ![Closing Repo](http://i.imgur.com/Uh1gZdx.png) -[*커밋 메세지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages) +[*커밋 메시지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages) ### Cross-Link Issues -같은 저장소의 다른 이슈를 링크하기 원한다면, `#`뒤에 이슈 번호만 입력하시면 자동으로 링크됩니다. +같은 저장소의 다른 이슈를 링크하기 원한다면, `#` 뒤에 이슈 번호만 입력하시면 자동으로 링크됩니다. 다른 저장소의 이슈를 링크하고 싶다면 `{user}/{repo}#이슈_번호`로 할 수 있습니다. (예 `tiimgreen/toc#12`) @@ -285,11 +287,11 @@ $ git commit -m "Fix screwup, fixes #12" ### Locking Conversations -풀 리퀘스트와 이슈는 레포지터리의 주인이나 협업자에 의해 잠글 수 있습니다. +풀 리퀘스트와 이슈는 저장소의 주인이나 협업자가 잠글 수 있습니다. ![Lock conversation](https://cloud.githubusercontent.com/assets/2723/3221693/bf54dd44-f00d-11e3-8eb6-bb51e825bc2c.png) -이는 프로젝트의 협업자가 아닌 사람은 더 이상 커맨트를 달 수 없게된다는 말입니다. +이는 프로젝트의 협업자가 아닌 사람은 더 이상 댓글을 달 수 없게 된다는 말입니다. ![Comments locked](https://cloud.githubusercontent.com/assets/2723/3221775/d6e513b0-f00e-11e3-9721-2131cb37c906.png) @@ -297,7 +299,7 @@ $ git commit -m "Fix screwup, fixes #12" ### CI Status on Pull Requests -정확히 설정되었다면, 풀 리퀘스트를 받거나 풀 리퀘스트에 새로운 커밋을 할 때 마다, [Travis CI](https://travis-ci.org/)가 풀 리퀘스트를 빌드 할 것입니다. [Travis CI 시작하기](http://docs.travis-ci.com/user/getting-started/)를 좀 더 읽어보세요. +정확히 설정되었다면, 풀 리퀘스트를 받거나 풀 리퀘스트에 새로운 커밋을 할 때마다, [Travis CI](https://travis-ci.org/)가 풀 리퀘스트를 빌드 할 것입니다. [Travis CI 시작하기](http://docs.travis-ci.com/user/getting-started/)를 좀 더 읽어보세요. [![Travis CI status](https://cloud.githubusercontent.com/assets/1687642/2700187/3a88838c-c410-11e3-9a46-e65e2a0458cd.png)](https://github.com/octokit/octokit.rb/pull/452) @@ -307,8 +309,8 @@ $ git commit -m "Fix screwup, fixes #12" 이슈, 풀 리퀘스트 둘 다 유저 인터페이스에서 필터링이 가능합니다. -레일즈 저장소 에서, 다음 필터는 -"activerecord" 라벨을 선택하여 만들어 집니다. +레일스 저장소 에서, "activerecord" 라벨을 +선택하여 다음 필터를 만들 수 있습니다. `is:issue label:activerecord` @@ -320,8 +322,8 @@ $ git commit -m "Fix screwup, fixes #12" `is:pr -label:activerecord` -GitHub는 열리거나 닫힌 이슈와 풀리퀘스트를 위한 탭이 있습니다만 머지된 -풀리퀘스트도 볼 수 있습니다. 다음 필터를 입력하기만 하면 됩니다. +GitHub는 열리거나 닫힌 이슈와 풀 리퀘스트를 위한 탭이 있습니다만 머지된 +풀 리퀘스트도 볼 수 있습니다. 다음 필터를 입력하기만 하면 됩니다. `is:merged` @@ -355,15 +357,15 @@ 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는 [Linguist](https://github.com/github/linguist)를 사용해 언어를 감지하고 신택스를 하이라이트합니다. [언어 YAML 파일](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)을 정독하시면 어떤 키워드가 유효한지 확인하실 수 있습니다. [*GitHub Flavored 마크다운에 대해 더 읽어 보세요.*](https://help.github.com/articles/github-flavored-markdown) ### Emojis -에모지는 풀 리퀘스트, 이슈, 커밋 메세지, 저장소 설명등에 `:에모지의_이름:`으로 넣을 수 있습니다. +에모지는 풀 리퀘스트, 이슈, 커밋 메시지, 저장소 설명 등에 `:에모지의_이름:`으로 넣을 수 있습니다. -GitHub에서 사용 가능한 에모지의 전 목록은 [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/) 나 [scotch-io/All-GitHub-Emoji-Icons](https://github.com/scotch-io/All-GitHub-Emoji-Icons)에서 확인하실 수 있습니다. +GitHub에서 사용 가능한 에모지의 전 목록은 [emoji-cheat-sheet.com](http://www.emoji-cheat-sheet.com/)나 [scotch-io/All-GitHub-Emoji-Icons](https://github.com/scotch-io/All-GitHub-Emoji-Icons)에서 확인하실 수 있습니다. 편리한 에모지 검색 엔진은 [emoji.muan.co](http://emoji.muan.co/)에 있습니다. GitHub에서 많이 사용하는 에모지 탑 5위는 이렇습니다. @@ -376,7 +378,7 @@ GitHub에서 많이 사용하는 에모지 탑 5위는 이렇습니다. ### Images/GIFs -커맨트나 README등등에 이미지와 GIF를 넣을 수 있습니다. +댓글이나 README 등에 이미지와 GIF를 넣을 수 있습니다. ``` ![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) @@ -390,11 +392,11 @@ GitHub에서 많이 사용하는 에모지 탑 5위는 이렇습니다. ![Peter don't care](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif) -모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다. +모든 이미지는 GitHub에서 캐시합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다. #### Embedding Images in GitHub Wiki -이미지를 위키 페이지에넣는 방법은 여럿 있습니다. 위에 보이는 일반 마크다운 문법도 있지만, 이미지에 높이와 넓이를 지정할 수 있는 문법도 있습니다. +이미지를 위키 페이지에 넣는 방법은 여럿 있습니다. 위에 보이는 일반 마크다운 문법도 있지만, 이미지에 높이와 넓이를 지정할 수 있는 문법도 있습니다. ```markdown [[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]] @@ -406,7 +408,7 @@ GitHub에서 많이 사용하는 에모지 탑 5위는 이렇습니다. ### Quick Quoting -스레드에 답글들 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다. +스레드에 답글을 달 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다. ![Quick Quote](https://f.cloud.github.com/assets/296432/124483/b0fa6204-6ef0-11e2-83c3-256c37fa7abc.gif) @@ -416,7 +418,7 @@ GitHub에서 많이 사용하는 에모지 탑 5위는 이렇습니다. _(크롬에서만 동작합니다)_ -스크린샷을 찍고 클립보드에 있는 경우 (mac: `cmd-ctrl-shift-4`), 간단히 이미지를 커맨트 색션에 붙여넣기(`cmd-v / ctrl-v`)할 수 있고 이는 자동으로 GitHub에 업로드 됩니다. +스크린샷을 찍고 클립보드에 복사한 경우 (mac: `cmd-ctrl-shift-4`), 간단히 이미지를 댓글 영역에 붙여넣을(`cmd-v / ctrl-v`) 수 있고 이는 자동으로 GitHub에 업로드 됩니다. ![Pasting Clipboard Image to Comments](https://cloud.githubusercontent.com/assets/39191/5794265/39c9b65a-9f1b-11e4-9bc7-04e41f59ea5f.png) @@ -439,7 +441,7 @@ _(크롬에서만 동작합니다)_ ### Task Lists -이슈와 풀 리퀘스트에서 밑의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.) +이슈와 풀 리퀘스트에서 아래의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.) ``` - [ ] Be awesome @@ -452,7 +454,7 @@ _(크롬에서만 동작합니다)_ ![Task List](http://i.imgur.com/jJBXhsY.png) -체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다. +체크박스를 클릭하면, 순수 마크다운에서 갱신이 이루어집니다. ``` - [x] Be awesome @@ -463,38 +465,42 @@ _(크롬에서만 동작합니다)_ - [ ] Sleep ``` -[*테스크 리스트에 대해 더 읽어 보세요.*](https://help.github.com/articles/writing-on-github#task-lists) +[*할 일 목록에 대해 더 읽어 보세요.*](https://help.github.com/articles/writing-on-github#task-lists) #### Task Lists in Markdown Documents + 이제 마크다운 문서에서 **읽기 전용** 체크리스트를 넣을 수 있습니다. ``` - [ ] Mercury - [x] Venus - [x] Earth + - [x] Moon - [x] Mars -- [ ] Jupiter + - [ ] Deimos + - [ ] Phobos ``` - [ ] Mercury - [x] Venus - [x] Earth + - [x] Moon - [x] Mars -- [ ] Jupiter + - [ ] Deimos + - [ ] Phobos -[*마크다운 문서에서의 테스크 리스트에 대해 더 읽어 보세요.*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) +[*마크다운 문서에서의 할 일 목록에 대해 더 읽어 보세요.*](https://github.com/blog/1825-task-lists-in-all-markdown-documents) ### Relative Links -상대 경로 링크는 마크다운 파일이 내부 컨텐츠로 링크될 때 추천합니다. +상대 경로 링크는 마크다운 파일이 내부 콘텐츠로 링크될 때 추천합니다. ```markdown [Link to a header](#awesome-section) - [Link to a file](docs/readme) ``` -절대 경로 링크는 URL이 변경 될 때 마다 변경해야 합니다. (예를 들어 저장소 이름 변경, 유저이름 변경, 프로젝트 포크) +절대 경로 링크는 URL이 변경 될 때마다 변경해야 합니다. (예를 들어 저장소 이름 변경, 아이디 변경, 프로젝트 포크) 상대 경로 링크를 사용하면 문서를 쉽게 스스로 독립적으로 만들 수 있습니다. [*상대 경로 링크에 대해 더 읽어 보세요.*](https://help.github.com/articles/relative-links-in-readmes) @@ -503,13 +509,13 @@ _(크롬에서만 동작합니다)_ 지킬로 작성된 페이지와 포스트에서, 저장소 정보는 예를 들어 `{{ site.github.project_title }}`처럼 `site.github` 이름 공간으로 사용하고 표시할 수 있습니다. -Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis)와 [@mentions](https://github.com/blog/821)을 지킬 포스트와 페이지에서 사용하게 합니다. +Jemoji와 jekyll-mentions 플러그인은 GitHub.com에서처럼 [emoji](#emojis)와 [@mentions](https://github.com/blog/821)를 지킬 포스트와 페이지에서 사용하게 합니다. -[*저장소 메타 데이타와 GitHub 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) +[*저장소 메타 데이터와 GitHub 페이지의 플러그인 지원에 대해 더 읽어 보세요.*](https://github.com/blog/1797-repository-metadata-and-plugin-support-for-github-pages) ### Viewing YAML Metadata in your Documents -[Jekyll](http://jekyllrb.com/)이나 [GitHub Pages](http://pages.github.com/)같은 많은 블로그에서 포스트의 처음에 YAML 포멧의 메타데이터를 필요로 합니다. GitHub는 이 메타 정보를 읽기 편하게 테이블로 표시해 줍니다. +[Jekyll](http://jekyllrb.com/)이나 [GitHub Pages](http://pages.github.com/) 같은 많은 블로그에서 포스트의 처음에 YAML 포멧의 메타데이터를 필요로 합니다. GitHub는 이 메타 정보를 읽기 편하게 테이블로 표시해 줍니다. ![YAML metadata](https://camo.githubusercontent.com/47245aa16728e242f74a9a324ce0d24c0b916075/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f36343035302f313232383236372f65303439643063362d323761302d313165332d396464382d6131636432323539393334342e706e67) @@ -517,15 +523,15 @@ Jemoji와 jekyll-mentions플러그인은 GitHub.com에서 처럼 [emoji](#emojis ### Rendering Tabular Data -GitHub는 `.csv` (comma-separated) 와 `.tsv` (tab-separated)파일에 대해 표(tabular) 데이터 보기를 지원합니다. +GitHub는 `.csv`(comma-separated)와 `.tsv`(tab-separated) 파일에 대해 표(tabular) 데이터 보기를 지원합니다. ![Tabular data](https://camo.githubusercontent.com/1b6dd0157ffb45d9939abf14233a0cb13b3b4dfe/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3238323735392f3937363436322f33323038336463652d303638642d313165332d393262322d3566323863313061353035392e706e67) -[*표 데이타 표시에 대해 더 읽어 보세요.*](https://github.com/blog/1601-see-your-csvs) +[*표 데이터 표시에 대해 더 읽어 보세요.*](https://github.com/blog/1601-see-your-csvs) ### Rendering PDF -GitHub에서 PDF를 렌더링할 수 있습니다. +GitHub에서 PDF를 렌더할 수 있습니다. ![PDF](https://cloud.githubusercontent.com/assets/1000669/7492902/f8493160-f42e-11e4-8cea-1cb4f02757e7.png) @@ -536,20 +542,21 @@ GitHub에서 PDF를 렌더링할 수 있습니다. 풀 리퀘스트가 머지된 후에, 아무 도움이 안되거나 머지가 잘못된 결정이었다는 걸 눈치 챌 때가 있습니다. -풀 리퀘스트 페이지의 커밋의 오른 쪽에 있는 **Revert** 버튼을 클릭하면 이 풀리퀘스트를 되돌리는 풀리퀘스트를 만들어 되돌릴 수 있습니다. +풀 리퀘스트 페이지의 커밋의 오른쪽에 있는 **Revert** 버튼을 클릭하면 이 풀 리퀘스트를 되돌리는 풀 리퀘스트를 만들어 되돌릴 수 있습니다. ![Revert button](https://camo.githubusercontent.com/0d3350caf2bb1cba53123ffeafc00ca702b1b164/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f68656c702f70756c6c5f72657175657374732f7265766572742d70756c6c2d726571756573742d6c696e6b2e706e67) [*풀 리퀘스트 되돌리기에 대해 더 읽어 보세요.*](https://github.com/blog/1857-introducing-the-revert-button) ### Diffs + #### Rendered Prose Diffs GitHub에서 지원하는 산문(prose) 파일(예를 들어 Markdown)이 있는 커밋과 풀 리퀘스트에서는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) -"rendered" 버튼을 클릭하시면 렌더된 문서에서 변경을 확인하실 수 있습니다. 렌더된 산문(prose) 뷰는 문장을 추가, 삭제, 변경했을때 유용합니다. +"rendered" 버튼을 클릭하시면 렌더된 문서에서 변경을 확인하실 수 있습니다. 렌더된 산문(prose) 뷰는 문장을 추가, 삭제, 변경했을 때 유용합니다. ![Rendered Prose Diffs](https://f.cloud.github.com/assets/17715/2003056/3997edb4-862b-11e3-90be-5e9586edecd7.png) @@ -557,7 +564,7 @@ GitHub에서 지원하는 산문(prose) 파일(예를 들어 Markdown)이 있는 #### Diffable Maps -지오데이타가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 GitHub는 무엇이 변경 되었는지 시각적으로 보여줍니다. +지오데이터가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 GitHub는 무엇이 변경 되었는지 시각적으로 보여줍니다. [![Diffable Maps](https://f.cloud.github.com/assets/282759/2090660/63f2e45a-8e97-11e3-9d8b-d4c8078b004e.gif)](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5) @@ -565,7 +572,7 @@ GitHub에서 지원하는 산문(prose) 파일(예를 들어 Markdown)이 있는 #### Expanding Context in Diffs -diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 있습니다. 전채 파일을 표시할때까지 계속 *펼칠* 수 있으며, GitHub에서 diff가 표시되는 장소라면 어디서든 사용가능합니다. +diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 있습니다. 전체 파일을 표시할 때까지 계속 *펼칠* 수 있으며, GitHub에서 diff가 표시되는 장소라면 어디서든 사용가능합니다. ![Expanding Context in Diffs](https://f.cloud.github.com/assets/22635/1610539/863c1f64-5584-11e3-82bf-151b406a272f.gif) @@ -573,7 +580,7 @@ diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 #### Diff or Patch of Pull Request -URL뒤에 `.diff` 나 `.patch`를 붙이면 풀 리퀘스트의 diff를 얻을 수 있습니다. +URL 뒤에 `.diff`나 `.patch`를 붙이면 풀 리퀘스트의 diff를 얻을 수 있습니다. 예를 들면 ``` @@ -605,7 +612,7 @@ index 88fcf69..8614873 100644 #### Rendering and diffing images -GitHub는 PNG, JPG, GIF, PSD를 포함한 여러 일반 적인 이미지 형식을 표시할 수 있습니다. 추가적으로 이미지 형식의 diff를 표시하는 여러 방법을 제공합니다. +GitHub는 PNG, JPG, GIF, PSD를 포함한 여러 일반적인 이미지 형식을 표시할 수 있습니다. 추가적으로 이미지 형식의 diff를 표시하는 여러 방법을 제공합니다. [![Diffable PSD](https://cloud.githubusercontent.com/assets/2546/3165594/55f2798a-eb56-11e3-92e7-b79ad791a697.gif)](https://github.com/blog/1845-psd-viewing-diffing @@ -676,8 +683,8 @@ $ git rm $(git ls-files -d) $ git status On branch master Changes not staged for commit: - deleted: a - deleted: c + deleted: a + deleted: c $ git rm $(git ls-files -d) rm 'a' @@ -686,19 +693,13 @@ rm 'c' $ git status On branch master Changes to be committed: - deleted: a - deleted: c + deleted: a + deleted: c ``` ### Previous Branch -커맨드 라인에서 이전 디렉터리로 이동하려면 이렇게 합니다. - -```bash -$ cd - -``` - -비슷하게, 깃에서 마지막 브랜치로 돌아가는 건 이렇게 할 수 있습니다. +Git에서 이전 브랜치로 돌아가는 건 이렇게 할 수 있습니다. ```bash $ git checkout - @@ -711,11 +712,11 @@ $ git checkout - # Switched to branch 'master' ``` -[*깃 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) +[*Git 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging) ### Stripspace -깃 Stripspace는 이런 일을 합니다. +Git Stripspace는 이런 일을 합니다. - 줄 끝의 공백을 제거 - 빈줄을 줄임 @@ -727,26 +728,26 @@ $ git checkout - $ git stripspace < README.md ``` -[*깃 `stripspace` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-stripspace) +[*Git `stripspace` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-stripspace) ### SSH keys -밑의 주소를 방문하면 공개 ssh 키의 목록을 일반 텍스트 형식으로 볼 수 있습니다. +아래 주소를 방문하면 공개 ssh 키의 목록을 일반 텍스트 형식으로 볼 수 있습니다. ``` https://github.com/{user}.keys ``` -e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) +예: [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) [*공개 ssh 키 접근에 대해 더 읽어 보세요.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) ### Checking out Pull Requests 풀 리퀘스트는 GitHub 저장소에서 사용하는 특별한 브랜치로 여러 방법으로 로컬로 -가져 올수 있습니다. +가져올 수 있습니다. -빠르게 `diff`나 `merge`를 하기위해 특정 풀 리퀘스트를 임시로 `FETCH_HEAD`로 +빠르게 `diff`나 `merge`를 하기 위해 특정 풀 리퀘스트를 임시로 `FETCH_HEAD`로 가져오려면 이렇게 합니다. ```bash @@ -783,7 +784,7 @@ $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' $ git checkout pr/42 pr-42 ``` -여러 저장소를 다루어야 한다면, 전역 깃 설정에서 풀 리퀘스트를 받을(fetching) 수 있도록 설정 할 수 도 있습니다. +여러 저장소를 다루어야 한다면, 전역 깃 설정에서 풀 리퀘스트를 받을(fetching) 수 있도록 설정 할 수도 있습니다. ```bash git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" @@ -826,15 +827,17 @@ $ git status ![git status](http://i.imgur.com/qjPyvXb.png) -이렇게 바뀝니다. +`-sb`를 추가하면 ```bash $ git status -sb ``` +이렇게 바뀝니다. + ![git status -sb](http://i.imgur.com/K0OY3nm.png) -[*깃 `status` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-status) +[*Git `status` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-status) ### Styled Git Log @@ -848,15 +851,15 @@ $ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %C ![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](http://i.imgur.com/58eOtkW.png) -[Palesz](http://stackoverflow.com/users/88355/palesz)님 고맙습니다. +[Palesz](http://stackoverflow.com/users/88355/palesz) 님 고맙습니다. -NOTE: 이 명령을 알리아스 (단축 명령)으로 넣을 수 있습니다. [여기](#aliases)의 소개를 보세요. +NOTE: 이 명령을 알리아스(단축 명령)로 넣을 수 있습니다. [여기](#aliases)의 소개를 보세요. -[*깃 `log` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-log) +[*Git `log` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-log) ### Git Query -깃 쿼리는 모든 이전 커밋 메시지에서 검색해 가장 최근의 쿼리에 맞는 커밋을 찾아줍니다. +Git 쿼리는 모든 이전 커밋 메시지에서 검색해 가장 최근의 쿼리에 맞는 커밋을 찾아줍니다. ```bash $ git show :/query @@ -870,33 +873,35 @@ $ git show :/typo ![git show :/query](http://i.imgur.com/icaGiNt.png) -NOTE: 나오려면 `q`를 누르세요. +*나오려면 `q`를 누르세요.* ### Git Grep -Git Grep은 패턴에 매치하는 줄의 목록을 반환합니다. +Git Grep은 패턴과 일치하는 줄의 목록을 반환합니다. 다음 명령을 실행해 보세요. + ```bash $ git grep aliases ``` + *aliases* 문자열이 포함된 모든 파일을 보여줍니다. ![git grep aliases](http://i.imgur.com/DL2zpQ9.png) *나오려면 `q`를 누르세요.* -여러 플레그를 이용해서 좀 더 복잡한 검색을 할 수 있습니다. 예를 들면, +여러 플래그를 이용해서 좀 더 복잡한 검색을 할 수 있습니다. 예를 들면, * `-e` 다음 파라미터는 패턴 (e.g. regex) - * `--and`, `--or`, `--not` 으로 여러 패턴을 조합 + * `--and`, `--or`, `--not`으로 여러 패턴을 조합 이렇게 사용할 수 있습니다. ```bash $ git grep -e pattern --and -e anotherpattern ``` -[*깃 `grep` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-grep) +[*Git `grep` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-grep) ### Merged Branches @@ -914,11 +919,11 @@ $ git branch --no-merged 이 명령어는 현재 브랜치에 머지되지 않은 브랜치의 목록을 보여줍니다. -[*깃 `branch` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-branch) +[*Git `branch` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-branch) ### Fixup and Autosquash -이전(HEAD의 한개 이상 전의) 커밋에 잘못된 부분이 있다면, 예를들어 `abcde`라면, +이전(HEAD의 한 개 이상 전의) 커밋에 잘못된 부분이 있다면, 예를 들어 `abcde`라면, 문제를 수정하고 밑의 커맨드를 입력해 고칠 수 있습니다. ```bash @@ -930,7 +935,7 @@ $ git rebase abcde^ --autosquash -i ### Web Server for Browsing Local Repositories -깃 `instaweb` 커맨드을 사용하면, 즉석에서 `gitweb`안에서 작업중인 저장소를 둘러 볼 +Git `instaweb` 커맨드을 사용하면, 즉석에서 `gitweb` 안에서 작업중인 저장소를 둘러 볼 수 있습니다. 이 커맨드는 `gitweb`과 로컬 저장소를 브라우징 하기 위한 웹 서버를 설정하는 스크립트입니다. ```bash @@ -941,7 +946,7 @@ Opens: ![Git instaweb](http://i.imgur.com/Dxekmqc.png) -[*깃 `instaweb` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-instaweb) +[*Git `instaweb` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-instaweb) ### Git Configurations @@ -949,19 +954,19 @@ Opens: #### Aliases -알리아스는 커스텀 깃 명령어를 등록할 수 있는 핼퍼입니다. 예를 들어 `git a`로 `git add --all`를 실행하게 할 수 있습니다. +알리아스는 커스텀 Git 명령어를 등록할 수 있는 헬퍼입니다. 예를 들어 `git a`로 `git add --all`를 실행하게 할 수 있습니다. -알리아스를 추가하려면 `~/.gitconfig`를 찾아 다음 포멧으로 입력하거나 +알리아스를 추가하려면 `~/.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 + co = checkout + cm = commit + p = push + # Show verbose output about tags, branches or remotes + tags = tag -l + branches = branch -a + remotes = remote -v ``` 커맨드 라인에서 다음 명령을 입력합니다. @@ -970,19 +975,19 @@ Opens: $ git config --global alias.new_alias git_function ``` -예를들면 +예를 들면 ```bash $ git config --global alias.cm commit ``` -NOTE: 여러 함수를 알리아스하려면 따옴표를 이용하세요. +여러 함수를 알리아스하려면 따옴표를 이용하세요. ```bash $ git config --global alias.ac 'add -A . && commit' ``` -여기 몇 가지 권장 알리아스가 있습니다. +여기 몇 가지 유용한 알리아스가 있습니다. | Alias | Current Command | What to Type | | --- | --- | --- | @@ -996,7 +1001,7 @@ $ git config --global alias.ac 'add -A . && commit' | `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 --"` | -*일부 알리아스는 [@mathiasbynens](https://github.com/mathiasbynens)님의 dotfiles에서 가져왔습니다.(https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig)* +*일부 알리아스는 [@mathiasbynens](https://github.com/mathiasbynens) 님의 dotfiles에서 가져왔습니다.(https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig)* #### Auto-correct @@ -1007,7 +1012,7 @@ $ git comit -m "Message" # git: 'comit' is not a git command. See 'git --help'. # Did you mean this? -# commit +# commit ``` `comit`을 쳤을 때 `commit`을 부르려면, 자동 교정을 켜두세요. @@ -1033,7 +1038,7 @@ $ git comit -m "Message" $ git config --global color.ui 1 ``` -[*깃 `config` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-config) +[*Git `config` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-config) ### Git Resources @@ -1047,11 +1052,12 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designers | http://hoth.entp.com/output/git_for_designers.html | | 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 | +| GitHub Training Kit | https://training.github.com/kit/ | | Git Visualization Playground | http://onlywei.github.io/explain-git-with-d3/#freeplay | +| Learn Git Branching | http://pcottle.github.io/learnGitBranching/ | +| A collection of useful .gitignore templates | https://github.com/github/gitignore | #### Git Books @@ -1064,3 +1070,17 @@ $ git config --global color.ui 1 | 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 | + +#### Git Videos +| Title | Link | +| ----- | ---- | +| Linus Torvalds on Git | https://www.youtube.com/watch?v=4XpnKHJAok8 | +| Introduction to Git with Scott Chacon | https://www.youtube.com/watch?v=ZDR433b0HJY | +| Git From the Bits Up | https://www.youtube.com/watch?v=MYP56QJpDr4 | +| Graphs, Hashes, and Compression, Oh My! | https://www.youtube.com/watch?v=ig5E8CcdM9g | +| GitHub Training & Guides | https://www.youtube.com/watch?list=PLg7s6cbtAD15G8lNyoaYDuKZSKyJrgwB-&v=FyfwLX4HAxM | + +#### Git Articles +| Title | Link | +| ----- | ---- | +| GitHub Flow | http://scottchacon.com/2011/08/31/github-flow.html | From 1d977dae887011441acc63dc6783b6290ef8eb8c Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 30 Dec 2015 20:09:41 +0000 Subject: [PATCH 251/292] Add @awesome-bot, as discussed in #144 --- .travis.yml | 10 ++++++++++ README.md | 4 +--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..041fd6b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: ruby + +rvm: + - 2.2 + +before_script: + - gem install awesome_bot + +script: + - awesome_bot README.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* diff --git a/README.md b/README.md index 4a46559..1ca5794 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # GitHub Cheat Sheet [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) -A collection of cool hidden and not so 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.http://confreaks.tv/videos/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)). +A collection of cool hidden and not so hidden features of Git and GitHub. This cheat sheet was inspired by [Zach Holman](https://github.com/holman)'s [Git and GitHub Secrets](http://confreaks.tv/videos/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)). *Shortlink: [`http://git.io/sheet`](http://git.io/sheet)* @@ -765,8 +765,6 @@ Some use-cases for this (that make sense), include: - Communicating with people using your repository. - The first commit of a repo, as the first commit cannot be rebased later: `git commit -m "init repo" --allow-empty`. -![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) - ### Styled Git Status Running: From c4711948bc63fcb773437d0dcf8b1823692b2c5b Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 3 Jan 2016 16:01:38 +0000 Subject: [PATCH 252/292] Check READMEs in other languages with awesome_bot --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 041fd6b..c149dcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,7 @@ before_script: script: - awesome_bot README.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* + - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* + - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* + - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* + - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* From a78ef158aaba3be26e10c1679172aa06019a840a Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 3 Jan 2016 16:16:27 +0000 Subject: [PATCH 253/292] Fix failing links --- .travis.yml | 10 +++++----- README.ja.md | 3 --- README.ko.md | 2 -- README.zh-cn.md | 3 --- README.zh-tw.md | 3 --- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index c149dcd..33b2ca3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ before_script: - gem install awesome_bot script: - - awesome_bot README.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* - - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* - - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* - - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* - - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* + - awesome_bot README.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ diff --git a/README.ja.md b/README.ja.md index a4accd3..f41fd2b 100644 --- a/README.ja.md +++ b/README.ja.md @@ -755,8 +755,6 @@ $ git commit -m "Big-ass commit" --allow-empty - リポジトリを利用して誰かと連絡を取りたい時 - リポジトリへの最初のコミットをやり直しできるようにしたい時: `git commit -m "init repo" --allow-empty`. -![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) - ### Gitステータスのスタイリング 普通に実行すると: @@ -982,7 +980,6 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designers | http://hoth.entp.com/output/git_for_designers.html | | 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 | diff --git a/README.ko.md b/README.ko.md index 1dac197..6978d6b 100644 --- a/README.ko.md +++ b/README.ko.md @@ -817,8 +817,6 @@ $ git commit -m "Big-ass commit" --allow-empty - 저장소를 사용하는 사람과의 대화 - 나중에 리베이스하지 않을 저장소의 첫 커밋으로 사용 `git commit -m "init repo" --allow-empty`. -![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) - ### Styled Git Status ```bash diff --git a/README.zh-cn.md b/README.zh-cn.md index d93427d..495e1bb 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -717,8 +717,6 @@ $ git commit -m "Big-ass commit" --allow-empty - 跟使用你仓库的其他人交流。 - 作为仓库的第一次提交,因为第一次提交后不能被 rebase: `git commit -m "init repo" --allow-empty`. - ![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) - ### 美化 Git Status 在命令行输入如下命令: @@ -913,7 +911,6 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | | 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 | diff --git a/README.zh-tw.md b/README.zh-tw.md index 9b7ba9a..a9dc93a 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -733,8 +733,6 @@ $ git commit -m "Big-ass commit" --allow-empty - 跟使用你倉庫的其他人交流。 - 作為倉庫的第一次提交,因為第一次提交後不能被 rebase: `git commit -m "init repo" --allow-empty`. - ![It ain't even that trolololol...](http://i.minus.com/il1jaw.gif) - ### 美化 Git Status 在命令行輸入如下命令: @@ -957,7 +955,6 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | -| Git for Designer | http://hoth.entp.com/output/git_for_designers.html | | 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 | From de3f3444218169b582b6445b7c3752e0d1885c75 Mon Sep 17 00:00:00 2001 From: Rafal Chmiel Date: Sun, 7 Feb 2016 16:59:58 +0000 Subject: [PATCH 254/292] Update "Empty Commits" (as in #149) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ca5794..4e565fa 100644 --- a/README.md +++ b/README.md @@ -763,7 +763,7 @@ Some use-cases for this (that make sense), include: - Annotating the start of a new bulk of work or a new feature. - Documenting when you make changes to the project that aren't code related. - Communicating with people using your repository. - - The first commit of a repo, as the first commit cannot be rebased later: `git commit -m "init repo" --allow-empty`. + - The first commit of a repository: `git commit -m "Initial commit" --allow-empty`. ### Styled Git Status Running: From 79b256fe4374ed02204f4981d044ac9fa7dcddc0 Mon Sep 17 00:00:00 2001 From: Tal Ater Date: Mon, 29 Feb 2016 12:39:21 +0200 Subject: [PATCH 255/292] Updated with new GitHub contribution files - Added info on .github folder. - Added details of new ISSUE_TEMPLATE file. - Added details of new PULL_REQUEST_TEMPLATE file. - Added link to issue and pull request template generator. --- README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4e565fa..08ef1ff 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,10 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - [Rendering and diffing images](#rendering-and-diffing-images) - [Hub](#hub) - - [Contributing Guidelines](#contributing-guidelines) + - [Contribution Guidelines](#contribution-guidelines) + - [CONTRIBUTING file](#contributing-file) + - [ISSUE_TEMPLATE file](#issue-template-file) + - [PULL_REQUEST_TEMPLATE file](#pull-request-template-file) - [Octicons](#octicons) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) @@ -591,13 +594,33 @@ $ hub clone tiimgreen/toc [*Check out some more cool commands Hub has to offer.*](https://github.com/github/hub#commands) -### Contributing Guidelines -Adding a `CONTRIBUTING` file to the root of your repository will add a link to your file when a contributor creates an Issue or opens a Pull Request. +### Contribution Guidelines +GitHub supports adding 3 different files which help users contribute to your project. +These files can either be placed in the root of your repository or a `.github` directory under the root. + +#### CONTRIBUTING File +Adding a `CONTRIBUTING` or `CONTRIBUTING.md` file to either the root of your repository or a `.github` directory will add a link to your file when a contributor creates an Issue or opens a Pull Request. ![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) [*Read more about contributing guidelines.*](https://github.com/blog/1184-contributing-guidelines) +#### ISSUE_TEMPLATE file +You can define a template for all new issues opened in your project. The content of this file will pre-populate the new issue box when users create new issues. Add an `ISSUE_TEMPLATE` or `ISSUE_TEMPLATE.md` file to either the root of your repository or a `.github` directory. + +[*Read more about issue templates.*](https://github.com/blog/2111-issue-and-pull-request-templates) + +[Issue template file generator](https://www.talater.com/open-source-templates/) + +![GitHub Issue template](https://cloud.githubusercontent.com/assets/25792/13120859/733479fe-d564-11e5-8a1f-a03f95072f7a.png) + +#### PULL_REQUEST_TEMPLATE file +You can define a template for all new pull requests opened in your project. The content of this file will pre-populate the text area when users create pull requests. Add a `PULL_REQUEST_TEMPLATE` or `PULL_REQUEST_TEMPLATE.md` file to either the root of your repository or a `.github` directory. + +[*Read more about pull request templates.*](https://github.com/blog/2111-issue-and-pull-request-templates) + +[Pull request template file generator](https://www.talater.com/open-source-templates/) + ### Octicons GitHubs icons (Octicons) have now been open sourced. From 7540099927a89e1500990adf972292bcd06d1b2b Mon Sep 17 00:00:00 2001 From: Tal Ater Date: Mon, 29 Feb 2016 12:41:06 +0200 Subject: [PATCH 256/292] Fixed Contributing anchor links in table of contents --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08ef1ff..0c6d25b 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Hub](#hub) - [Contribution Guidelines](#contribution-guidelines) - [CONTRIBUTING file](#contributing-file) - - [ISSUE_TEMPLATE file](#issue-template-file) - - [PULL_REQUEST_TEMPLATE file](#pull-request-template-file) + - [ISSUE_TEMPLATE file](#issue_template-file) + - [PULL_REQUEST_TEMPLATE file](#pull_request_template-file) - [Octicons](#octicons) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) From 75b034d4d080bb0940775f738e155435c94fb4d8 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 29 Feb 2016 22:17:53 +0000 Subject: [PATCH 257/292] Remove erroring links --- README.zh-cn.md | 2 +- README.zh-tw.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 495e1bb..6ad60e5 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -921,7 +921,7 @@ $ git config --global color.ui 1 | ----- | ---- | | 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 Peepcode | http://peepcode.com/products/git-internals-pdf | +| 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 | diff --git a/README.zh-tw.md b/README.zh-tw.md index a9dc93a..241f6bd 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -965,7 +965,7 @@ $ git config --global color.ui 1 | ----- | ---- | | 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 Peepcode | http://peepcode.com/products/git-internals-pdf | +| 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 | From 5fdd48875db1fbb406f2e1377fb3c3b6037c9eec Mon Sep 17 00:00:00 2001 From: Chayoung You Date: Wed, 2 Mar 2016 14:45:51 +0900 Subject: [PATCH 258/292] Update Korean translation to b85d914 --- README.ko.md | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/README.ko.md b/README.ko.md index 6978d6b..c2420f9 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,6 +1,6 @@ # GitHub 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) -Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://www.confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets)([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))과 WDCNZ 2013에서 발표한 [Git과 GitHub에 대한 더 많은 비밀들](https://vimeo.com/72955426)([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. +Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://confreaks.tv/videos/aloharuby2012-git-and-github-secrets)([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))과 WDCNZ 2013에서 발표한 [Git과 GitHub에 대한 더 많은 비밀들](https://vimeo.com/72955426)([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. *단축주소: [`http://git.io/sheet`](http://git.io/sheet)* @@ -48,7 +48,10 @@ Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다 - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - [Rendering and diffing images](#rendering-and-diffing-images) - [Hub](#hub) - - [Contributing Guidelines](#contributing-guidelines) + - [Contribution Guidelines](#contribution-guidelines) + - [CONTRIBUTING file](#contributing-file) + - [ISSUE_TEMPLATE file](#issue_template-file) + - [PULL_REQUEST_TEMPLATE file](#pull_request_template-file) - [Octicons](#octicons) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) @@ -620,7 +623,7 @@ GitHub는 PNG, JPG, GIF, PSD를 포함한 여러 일반적인 이미지 형식 ### Hub -[Hub](https://github.com/github/hub)는 GitHub를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다. +[Hub](https://github.com/github/hub)는 GitHub를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 Git 래퍼입니다. 이렇게 할 수 있습니다. @@ -630,21 +633,44 @@ $ hub clone tiimgreen/toc [*Hub가 제공하는 더 멋진 기능들을 확인해 보세요.*](https://github.com/github/hub#commands) -### Contributing Guidelines +### Contribution Guidelines -저장소의 제일 위에 `CONTRIBUTING` 파일을 넣어두면 기여자가 이슈를 만들거나 풀 리퀘스트를 만들 때 링크로 보여줍니다. +GitHub는 프로젝트에 기여하는 사용자를 위한 세 가지 각기 다른 파일을 지원합니다. +이 파일은 저장소의 제일 위나 그 아래의 `.github` 디렉터리에 위치할 수 있습니다. + +### CONTRIBUTING File + +저장소의 제일 위나 그 아래의 `.github` 디렉터리에 `CONTRIBUTING`이나 `CONTRIBUTING.md` 파일을 넣어두면 기여자가 이슈를 만들거나 풀 리퀘스트를 만들 때 링크로 보여줍니다. ![Contributing Guidelines](https://camo.githubusercontent.com/71995d6b0e620a9ef1ded00a04498241c69dd1bf/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f736b697463682f6973737565732d32303132303931332d3136323533392e6a7067) [*기여하기에 대해 더 읽어 보세요.*](https://github.com/blog/1184-contributing-guidelines) +### ISSUE_TEMPLATE file + +프로젝트의 새로운 이슈에 사용될 템플릿을 지정할 수 있습니다. 사용자가 새 이슈를 생성하면 이슈 창이 이 파일의 내용으로 채워집니다. 저장소의 제일 위나 그 아래의 `.github` 디렉터리에 `ISSUE_TEMPLATE`이나 `ISSUE_TEMPLATE.md` 파일을 넣어 두세요. + +[*이슈 템플릿에 대해 더 읽어 보세요.*](https://github.com/blog/2111-issue-and-pull-request-templates) + +[이슈 템플릿 파일 생성기](https://www.talater.com/open-source-templates/) + +![GitHub Issue template](https://cloud.githubusercontent.com/assets/25792/13120859/733479fe-d564-11e5-8a1f-a03f95072f7a.png) + +### PULL_REQUEST_TEMPLATE file + +프로젝트의 새로운 풀 리퀘스트에 사용될 템플릿을 지정할 수 있습니다. 사용자가 새 풀 리퀘스트를 생성하면 텍스트 영역이 이 파일의 내용으로 채워집니다. 저장소의 제일 위나 `.github` 디렉터리에 `PULL_REQUEST_TEMPLATE`이나 `PULL_REQUEST_TEMPLATE.md` 파일을 넣어 두세요. + +[*풀 리퀘스트 템플릿에 대해 더 읽어 보세요.*](https://github.com/blog/2111-issue-and-pull-request-templates) + +[풀 리퀘스트 템플릿 파일 생성기](https://www.talater.com/open-source-templates/) + ### Octicons GitHub 아이콘(옥티콘)이 이제 오픈소스가 되었습니다. ![Octicons](https://og.github.com/octicons/octicons@1200x630.png) -[*깃 허브의 옥티콘에 대해 더 읽어보세요.*](https://octicons.github.com) +[*GitHub 옥티콘에 대해 더 읽어보세요.*](https://octicons.github.com) ### GitHub Resources @@ -784,7 +810,7 @@ $ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*' $ git checkout pr/42 pr-42 ``` -여러 저장소를 다루어야 한다면, 전역 깃 설정에서 풀 리퀘스트를 받을(fetching) 수 있도록 설정 할 수도 있습니다. +여러 저장소를 다루어야 한다면, 전역 Git 설정에서 풀 리퀘스트를 받을(fetching) 수 있도록 설정 할 수도 있습니다. ```bash git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*" @@ -815,7 +841,7 @@ $ git commit -m "Big-ass commit" --allow-empty - 한 뭉치의 일을 시작하기 전에 주석으로 사용 - 코드와 관련없는 프로젝트 수정을 할때 주석으로 사용 - 저장소를 사용하는 사람과의 대화 - - 나중에 리베이스하지 않을 저장소의 첫 커밋으로 사용 `git commit -m "init repo" --allow-empty`. + - 저장소의 첫 커밋으로 사용 `git commit -m "Initial commit" --allow-empty` ### Styled Git Status @@ -928,8 +954,8 @@ $ git branch --no-merged $ git commit --fixup=abcde $ git rebase abcde^ --autosquash -i ``` -[*깃 `commit` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-commit) -[*깃 `rebase` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-rebase) +[*Git `commit` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-commit) +[*Git `rebase` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-rebase) ### Web Server for Browsing Local Repositories @@ -1030,7 +1056,7 @@ $ git comit -m "Message" #### Color -깃 커맨드 라인에 색을 넣으려면 이렇게 하세요. +Git 커맨드 라인에 색을 넣으려면 이렇게 하세요. ```bash $ git config --global color.ui 1 @@ -1070,6 +1096,7 @@ $ git config --global color.ui 1 | Git: Version Control for Everyone | http://www.packtpub.com/git-version-control-for-everyone/book | #### Git Videos + | Title | Link | | ----- | ---- | | Linus Torvalds on Git | https://www.youtube.com/watch?v=4XpnKHJAok8 | @@ -1079,6 +1106,7 @@ $ git config --global color.ui 1 | GitHub Training & Guides | https://www.youtube.com/watch?list=PLg7s6cbtAD15G8lNyoaYDuKZSKyJrgwB-&v=FyfwLX4HAxM | #### Git Articles + | Title | Link | | ----- | ---- | | GitHub Flow | http://scottchacon.com/2011/08/31/github-flow.html | From 37b25c10e8f51b312fdf52c7cd6093726d66167d Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 27 Mar 2016 22:51:00 +0100 Subject: [PATCH 259/292] GitHub Studen Developer Pack --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0c6d25b..bf9a675 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [ISSUE_TEMPLATE file](#issue_template-file) - [PULL_REQUEST_TEMPLATE file](#pull_request_template-file) - [Octicons](#octicons) + - [GitHub Student Developer Pack](#gitHub-student-developer-pack) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [Git](#git) @@ -628,6 +629,13 @@ GitHubs icons (Octicons) have now been open sourced. [*Read more about GitHub's Octicons*](https://octicons.github.com) +### GitHub Student Developer Pack + +If you are a student you will be eligible for the GitHub Student Developer Pack. This gives you free credit, free trials and early access to software that will help you when developing. + +![GitHub Student Developer Pack](http://i.imgur.com/9ru3K43.png) + +[*Read more about GitHub's Student Developer Pack](https://education.github.com/pack) ### GitHub Resources | Title | Link | From 9399a563ae63c48014d49d7de43468c251be6eeb Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 27 Mar 2016 22:52:37 +0100 Subject: [PATCH 260/292] Typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf9a675..1d886a1 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [ISSUE_TEMPLATE file](#issue_template-file) - [PULL_REQUEST_TEMPLATE file](#pull_request_template-file) - [Octicons](#octicons) - - [GitHub Student Developer Pack](#gitHub-student-developer-pack) + - [GitHub Student Developer Pack](#github-student-developer-pack) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [Git](#git) @@ -635,7 +635,7 @@ If you are a student you will be eligible for the GitHub Student Developer Pack. ![GitHub Student Developer Pack](http://i.imgur.com/9ru3K43.png) -[*Read more about GitHub's Student Developer Pack](https://education.github.com/pack) +[*Read more about GitHub's Student Developer Pack*](https://education.github.com/pack) ### GitHub Resources | Title | Link | From 2e998473e954b7e12b4b2392ea813b6192b48226 Mon Sep 17 00:00:00 2001 From: "Francis T. O'Donovan" Date: Thu, 8 Sep 2016 12:35:38 -0400 Subject: [PATCH 261/292] Minor format-change suggestions for README.md --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 1d886a1..0ede426 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c ## GitHub ### Ignore Whitespace -Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed. +Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabling you to see only the code that has changed. ![Diff without whitespace](https://camo.githubusercontent.com/797184940defadec00393e6559b835358a863eeb/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f776869746573706163652e706e67) @@ -138,7 +138,7 @@ To use GitHub to compare branches, change the URL to look like this: https://github.com/{user}/{repo}/compare/{range} ``` -Where `{range} = master...4-1-stable` +where `{range} = master...4-1-stable` For example: @@ -155,7 +155,7 @@ https://github.com/rails/rails/compare/master@{1.day.ago}...master https://github.com/rails/rails/compare/master@{2014-10-04}...master ``` -*Dates are in the format `YYYY-MM-DD`* +*Here, dates are in the format `YYYY-MM-DD`* ![Another compare example](http://i.imgur.com/5dtzESz.png) @@ -188,7 +188,7 @@ https://github.com/rails/rails/compare/byroot:master...master ![Gist](http://i.imgur.com/VkKI1LC.png?1) -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. +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. Gists can be treated as a repository so they can be cloned like any other: @@ -236,7 +236,7 @@ When on a repository page, keyboard shortcuts allow you to navigate easily. - Pressing `w` will bring up the branch selector. - Pressing `s` will focus the search field for the current repository. Pressing Backspace to delete the “This repository” pill changes the field to search all of GitHub. - Pressing `l` will edit labels on existing Issues. - - 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. + - 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. To see all of the shortcuts for the current page press `?`: @@ -245,9 +245,9 @@ To see all of the shortcuts for the current page press `?`: [Read more about search syntax you can use.](https://help.github.com/articles/search-syntax/) ### Line Highlighting in Repositories -Either adding `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. +Either adding, e.g., `#L52` to the end of a code file URL or simply clicking the line number will highlight that line number. -It also works with ranges, e.g. `#L53-L60`, to select ranges, hold `shift` and click two lines: +It also works with ranges, e.g., `#L53-L60`, to select ranges, hold `shift` and click two lines: ``` https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 @@ -271,7 +271,7 @@ This closes the issue and references the closing commit. ### Cross-Link Issues If you want to link to another issue in the same repository, simply type hash `#` then the issue number, and it will be auto-linked. -To link to an issue in another repository, `{user}/{repo}#ISSUE_NUMBER` e.g. `tiimgreen/toc#12`. +To link to an issue in another repository, `{user}/{repo}#ISSUE_NUMBER`, e.g., `tiimgreen/toc#12`. ![Cross-Link Issues](https://camo.githubusercontent.com/447e39ab8d96b553cadc8d31799100190df230a8/68747470733a2f2f6769746875622d696d616765732e73332e616d617a6f6e6177732e636f6d2f626c6f672f323031312f736563726574732f7265666572656e6365732e706e67) @@ -478,7 +478,7 @@ Relative links are recommended in your Markdown files when linking to internal c [Link to a file](docs/readme) ``` -Absolute links have to be updated whenever the URL changes (e.g. repository renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own. +Absolute links have to be updated whenever the URL changes (e.g., repository renamed, username changed, project forked). Using relative links makes your documentation easily stand on its own. [*Read more about relative links.*](https://help.github.com/articles/relative-links-in-readmes/) @@ -522,7 +522,7 @@ You can revert it by clicking the **Revert** button on the right side of a commi ### Diffs #### Rendered Prose Diffs -Commits and pull requests, including rendered documents supported by GitHub (e.g. Markdown), feature *source* and *rendered* views. +Commits and pull requests, including rendered documents supported by GitHub (e.g., Markdown), feature *source* and *rendered* views. ![Source / Rendered view](https://github-images.s3.amazonaws.com/help/repository/rendered_prose_diff.png) @@ -723,7 +723,7 @@ You can get a list of public ssh keys in plain text format by visiting: https://github.com/{user}.keys ``` -e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) +e.g., [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) [*Read more about accessing public ssh keys.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) @@ -731,7 +731,7 @@ e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) Pull Requests are special branches on the GitHub repository which can be retrieved locally in several ways: -Retrieve a specific Pull Request and store it temporarily in `FETCH_HEAD` for quickly `diff`ing or `merge`ing: +Retrieve a specific Pull Request and store it temporarily in `FETCH_HEAD` for quickly `diff`-ing or `merge`-ing: ```bash $ git fetch origin refs/pull/[PR-Number]/head @@ -803,7 +803,7 @@ Running: $ git status ``` -Produces: +produces: ![git status](http://i.imgur.com/qjPyvXb.png) @@ -813,7 +813,7 @@ By adding `-sb`: $ git status -sb ``` -This is produced: +this is produced: ![git status -sb](http://i.imgur.com/K0OY3nm.png) @@ -826,7 +826,7 @@ Running: $ 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 ``` -Produces: +produces: ![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](http://i.imgur.com/58eOtkW.png) @@ -843,7 +843,7 @@ A Git query allows you to search all your previous commit messages and find the $ git show :/query ``` -Where `query` (case-sensitive) is the term you want to search, this then finds the last one and gives details on the lines that were changed. +where `query` (case-sensitive) is the term you want to search, this then finds the last one and gives details on the lines that were changed. ```bash $ git show :/typo @@ -869,7 +869,7 @@ will show all the files containing the string *aliases*. You can also use multiple flags for more advanced search. For example: - * `-e` The next parameter is the pattern (e.g. regex) + * `-e` The next parameter is the pattern (e.g., regex) * `--and`, `--or` and `--not` Combine multiple patterns. Use it like this: @@ -886,7 +886,7 @@ Running: $ git branch --merged ``` -Will give you a list of all branches that have been merged into your current branch. +will give you a list of all branches that have been merged into your current branch. Conversely: @@ -894,7 +894,7 @@ Conversely: $ git branch --no-merged ``` -Will give you a list of branches that have not been merged into your current branch. +will give you a list of branches that have not been merged into your current branch. [*Read more about the Git `branch` command.*](http://git-scm.com/docs/git-branch) @@ -914,7 +914,7 @@ Use the Git `instaweb` command to instantly browse your working repository in `g $ git instaweb ``` -Opens: +opens: ![Git instaweb](http://i.imgur.com/Dxekmqc.png) From 1e164f37798bb2b6a96769d94d2c658544806904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Dur=C3=A1n=20Balda?= Date: Fri, 21 Oct 2016 20:13:09 +0200 Subject: [PATCH 262/292] Fix travis build --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33b2ca3..23086e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ before_script: - gem install awesome_bot script: - - awesome_bot README.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/...,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ From b6818ae8a43d62c99a0855677fba5b915731eba4 Mon Sep 17 00:00:00 2001 From: ReadmeCritic Date: Thu, 2 Mar 2017 09:23:36 -0800 Subject: [PATCH 263/292] [ci] improve travis.yml: use white list variable --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 23086e4..b1137c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,9 @@ before_script: - gem install awesome_bot script: - - awesome_bot README.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ - - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - wl=https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - awesome_bot README.md --allow-dupe --allow-redirect --white-list $wl + - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list $wl + - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list $wl + - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list $wl + - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list $wl From 9a56e714d5232a706d915081d83c54899c2142af Mon Sep 17 00:00:00 2001 From: ReadmeCritic Date: Thu, 2 Mar 2017 09:24:25 -0800 Subject: [PATCH 264/292] [ci] travis.yml: white list vimeo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b1137c5..82ec2db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ before_script: - gem install awesome_bot script: - - wl=https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/ + - wl=https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/,vimeo - awesome_bot README.md --allow-dupe --allow-redirect --white-list $wl - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list $wl - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list $wl From b599173c7faa43146210a5d475df3aa5c5d3ad93 Mon Sep 17 00:00:00 2001 From: ReadmeCritic Date: Thu, 2 Mar 2017 09:25:06 -0800 Subject: [PATCH 265/292] [ci] improve travis.yml: update spacing --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82ec2db..74e1227 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ before_script: script: - wl=https://github.com/rails/rails/compare/master@,http://git.io/abc123,https://github.com/..,youtube,chrome.google.com/webstore,https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig*,https://github.com/user/repo/compare/,vimeo - - awesome_bot README.md --allow-dupe --allow-redirect --white-list $wl - - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list $wl - - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list $wl + - awesome_bot README.md --allow-dupe --allow-redirect --white-list $wl + - awesome_bot README.ko.md --allow-dupe --allow-redirect --white-list $wl + - awesome_bot README.ja.md --allow-dupe --allow-redirect --white-list $wl - awesome_bot README.zh-cn.md --allow-dupe --allow-redirect --white-list $wl - awesome_bot README.zh-tw.md --allow-dupe --allow-redirect --white-list $wl From 87052c179908c88358398a518fd638d8bcbe3d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Dur=C3=A1n=20Balda?= Date: Tue, 18 Oct 2016 21:48:40 +0200 Subject: [PATCH 266/292] Move SSH keys section into GitHub --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1d886a1..61bad1c 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,11 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub Student Developer Pack](#github-student-developer-pack) - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) + - [SSH keys](#ssh-keys) - [Git](#git) - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - [Previous Branch](#previous-branch) - [Stripspace](#stripspace) - - [SSH keys](#ssh-keys) - [Checking out Pull Requests](#checking-out-pull-requests) - [Empty Commits](#empty-commits) - [Styled Git Status](#styled-git-status) @@ -656,6 +656,18 @@ If you are a student you will be eligible for the GitHub Student Developer Pack. | Git and GitHub Secrets | https://www.youtube.com/watch?v=Foz9yvMkvlA | | More Git and GitHub Secrets | https://www.youtube.com/watch?v=p50xsL-iVgU | +### SSH keys + +You can get a list of public ssh keys in plain text format by visiting: + +``` +https://github.com/{user}.keys +``` + +e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) + +[*Read more about accessing public ssh keys.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) + ## Git ### Remove All Deleted Files from the Working Tree When you delete a lot of files using `/bin/rm` you can use the following command to remove them from the working tree and from the index, eliminating the need to remove each one individually: @@ -715,18 +727,6 @@ $ git stripspace < README.md [*Read more about the Git `stripspace` command.*](http://git-scm.com/docs/git-stripspace) -### SSH keys - -You can get a list of public ssh keys in plain text format by visiting: - -``` -https://github.com/{user}.keys -``` - -e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) - -[*Read more about accessing public ssh keys.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) - ### Checking out Pull Requests Pull Requests are special branches on the GitHub repository which can be retrieved locally in several ways: From e07b347251d69d433bf40e7946ad2e67cd69b13c Mon Sep 17 00:00:00 2001 From: Limon Monte Date: Wed, 22 Mar 2017 00:36:18 +0200 Subject: [PATCH 267/292] Fix Markdown header --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d886a1..ffe6d74 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*Read more about the Git `clone` command.*](http://git-scm.com/docs/git-clone) -###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: @@ -511,7 +511,7 @@ GitHub supports rendering PDF: [*Read more about rendering PDF.*](https://github.com/blog/1974-pdf-viewing) -###Revert a Pull Request +### 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. From f38593a63455c853f8752e8f73e3aa5645dc935b Mon Sep 17 00:00:00 2001 From: Joe Block Date: Sun, 26 Mar 2017 12:11:46 -0700 Subject: [PATCH 268/292] Add link to git-extra-commands --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1d886a1..5e89509 100644 --- a/README.md +++ b/README.md @@ -1025,6 +1025,7 @@ $ git config --global color.ui 1 | Git Visualization Playground | http://onlywei.github.io/explain-git-with-d3/#freeplay | | Learn Git Branching | http://pcottle.github.io/learnGitBranching/ | | A collection of useful .gitignore templates | https://github.com/github/gitignore | +| Unixorn's git-extra-commands collection of git scripts | https://github.com/unixorn/git-extra-commands | #### Git Books | Title | Link | From 031e83f0b7a79ca443cae1ed76ef76531142472a Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 16 Apr 2017 15:53:29 +0100 Subject: [PATCH 269/292] list formatting --- README.md | 140 +++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 1d4e657..71a9388 100644 --- a/README.md +++ b/README.md @@ -6,76 +6,76 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c *Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* ## Table of Contents - - [GitHub](#github) - - [Ignore Whitespace](#ignore-whitespace) - - [Adjust Tab Space](#adjust-tab-space) - - [Commit History by Author](#commit-history-by-author) - - [Cloning a Repository](#cloning-a-repository) - - [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) - - [Line Highlighting in Repositories](#line-highlighting-in-repositories) - - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) - - [Cross-Link Issues](#cross-link-issues) - - [Locking Conversations](#locking-conversations) - - [CI Status on Pull Requests](#ci-status-on-pull-requests) - - [Filters](#filters) - - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) - - [Emojis](#emojis) - - [Images/GIFs](#imagesgifs) - - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) - - [Quick Quoting](#quick-quoting) - - [Pasting Clipboard Image to Comments](#pasting-clipboard-image-to-comments) - - [Quick Licensing](#quick-licensing) - - [Task Lists](#task-lists) - - [Task Lists in Markdown Documents](#task-lists-in-markdown-documents) - - [Relative Links](#relative-links) - - [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) - - [Rendering PDF](#rendering-pdf) - - [Revert a Pull Request](#revert-a-pull-request) - - [Diffs](#diffs) - - [Rendered Prose Diffs](#rendered-prose-diffs) - - [Diffable Maps](#diffable-maps) - - [Expanding Context in Diffs](#expanding-context-in-diffs) - - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) - - [Rendering and diffing images](#rendering-and-diffing-images) - - [Hub](#hub) - - [Contribution Guidelines](#contribution-guidelines) - - [CONTRIBUTING file](#contributing-file) - - [ISSUE_TEMPLATE file](#issue_template-file) - - [PULL_REQUEST_TEMPLATE file](#pull_request_template-file) - - [Octicons](#octicons) - - [GitHub Student Developer Pack](#github-student-developer-pack) - - [GitHub Resources](#github-resources) - - [GitHub Talks](#github-talks) - - [SSH keys](#ssh-keys) - - [Git](#git) - - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - - [Previous Branch](#previous-branch) - - [Stripspace](#stripspace) - - [Checking out Pull Requests](#checking-out-pull-requests) - - [Empty Commits](#empty-commits) - - [Styled Git Status](#styled-git-status) - - [Styled Git Log](#styled-git-log) - - [Git Query](#git-query) - - [Git Grep](#git-grep) - - [Merged Branches](#merged-branches) - - [Fixup and Autosquash](#fixup-and-autosquash) - - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) - - [Git Configurations](#git-configurations) - - [Aliases](#aliases) - - [Auto-Correct](#auto-correct) - - [Color](#color) - - [Git Resources](#git-resources) - - [Git Books](#git-books) - - [Git Videos](#git-videos) - - [Git Articles](#git-articles) + - [GitHub](#github) + - [Ignore Whitespace](#ignore-whitespace) + - [Adjust Tab Space](#adjust-tab-space) + - [Commit History by Author](#commit-history-by-author) + - [Cloning a Repository](#cloning-a-repository) + - [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) + - [Line Highlighting in Repositories](#line-highlighting-in-repositories) + - [Closing Issues via Commit Messages](#closing-issues-via-commit-messages) + - [Cross-Link Issues](#cross-link-issues) + - [Locking Conversations](#locking-conversations) + - [CI Status on Pull Requests](#ci-status-on-pull-requests) + - [Filters](#filters) + - [Syntax Highlighting in Markdown Files](#syntax-highlighting-in-markdown-files) + - [Emojis](#emojis) + - [Images/GIFs](#imagesgifs) + - [Embedding Images in GitHub Wiki](#embedding-images-in-github-wiki) + - [Quick Quoting](#quick-quoting) + - [Pasting Clipboard Image to Comments](#pasting-clipboard-image-to-comments) + - [Quick Licensing](#quick-licensing) + - [Task Lists](#task-lists) + - [Task Lists in Markdown Documents](#task-lists-in-markdown-documents) + - [Relative Links](#relative-links) + - [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) + - [Rendering PDF](#rendering-pdf) + - [Revert a Pull Request](#revert-a-pull-request) + - [Diffs](#diffs) + - [Rendered Prose Diffs](#rendered-prose-diffs) + - [Diffable Maps](#diffable-maps) + - [Expanding Context in Diffs](#expanding-context-in-diffs) + - [Diff or Patch of Pull Request](#diff-or-patch-of-pull-request) + - [Rendering and diffing images](#rendering-and-diffing-images) + - [Hub](#hub) + - [Contribution Guidelines](#contribution-guidelines) + - [CONTRIBUTING file](#contributing-file) + - [ISSUE_TEMPLATE file](#issue_template-file) + - [PULL_REQUEST_TEMPLATE file](#pull_request_template-file) + - [Octicons](#octicons) + - [GitHub Student Developer Pack](#github-student-developer-pack) + - [GitHub Resources](#github-resources) + - [GitHub Talks](#github-talks) + - [SSH keys](#ssh-keys) + - [Git](#git) + - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) + - [Previous Branch](#previous-branch) + - [Stripspace](#stripspace) + - [Checking out Pull Requests](#checking-out-pull-requests) + - [Empty Commits](#empty-commits) + - [Styled Git Status](#styled-git-status) + - [Styled Git Log](#styled-git-log) + - [Git Query](#git-query) + - [Git Grep](#git-grep) + - [Merged Branches](#merged-branches) + - [Fixup and Autosquash](#fixup-and-autosquash) + - [Web Server for Browsing Local Repositories](#web-server-for-browsing-local-repositories) + - [Git Configurations](#git-configurations) + - [Aliases](#aliases) + - [Auto-Correct](#auto-correct) + - [Color](#color) + - [Git Resources](#git-resources) + - [Git Books](#git-books) + - [Git Videos](#git-videos) + - [Git Articles](#git-articles) ## GitHub ### Ignore Whitespace From 653b237a056cfe40f44ca93fc2b9a19f8c5bcfdf Mon Sep 17 00:00:00 2001 From: Guillaume Chevalier Date: Thu, 29 Jun 2017 15:15:10 -0400 Subject: [PATCH 270/292] Added an article for managing large files Git Large File Storage (Git LFS) is the a new official GitHub addon for managing huge files. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6d59580..93da067 100644 --- a/README.md +++ b/README.md @@ -1051,3 +1051,4 @@ $ git config --global color.ui 1 | Title | Link | | ----- | ---- | | GitHub Flow | http://scottchacon.com/2011/08/31/github-flow.html | +| Migrating to Git Large File Storate (Git LFS) | http://vooban.com/en/tips-articles-geek-stuff/migrating-to-git-lfs-for-developing-deep-learning-applications-with-large-files/ | From 29fbe334fd2ee913b5a1b1a71eae1e0f55de110b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E8=B1=B9?= <007seadog@gmail.com> Date: Mon, 23 Oct 2017 22:07:44 -0500 Subject: [PATCH 271/292] Fixed markdown rendering problem Fixed markdown rendering problem --- README.zh-cn.md | 4 ++-- README.zh-tw.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.zh-cn.md b/README.zh-cn.md index 6ad60e5..76f9f47 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -105,8 +105,8 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*更多对 Git `clone` 命令的介绍.*](http://git-scm.com/docs/git-clone) -###分支 -####将某个分支与其他所有分支进行对比 +### 分支 +#### 将某个分支与其他所有分支进行对比 当你查看某个仓库的分支(Branches)页面(紧挨着 Commits 链接)时 diff --git a/README.zh-tw.md b/README.zh-tw.md index 241f6bd..aca70d7 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -107,8 +107,8 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet [*更多對 Git `clone` 命令的介紹.*](http://git-scm.com/docs/git-clone) -###分支 -####將某個分支與其他所有分支進行比對 +### 分支 +#### 將某個分支與其他所有分支進行比對 當你查看某個倉庫的分支(Branches)頁面(緊挨著 Commits 連接)時 From a96f4fab81dca2e5ae6e4cfbd44f470e26c6c838 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Wed, 14 Mar 2018 15:24:21 +0000 Subject: [PATCH 272/292] Add Git God to git resources --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6d59580..a5c01cb 100644 --- a/README.md +++ b/README.md @@ -1018,6 +1018,7 @@ $ git config --global color.ui 1 | Official Git Tutorial | http://git-scm.com/docs/gittutorial | | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | +| Git God | https://github.com/gorosgobe/git-god | | Ry's Git Tutorial | http://rypress.com/tutorials/git/index | | Git for Computer Scientists | http://eagain.net/articles/git-for-computer-scientists/ | | Git Magic | http://www-cs-students.stanford.edu/~blynn/gitmagic/ | From 627fab4879b9fce0005b18ac528f71c1d1b08609 Mon Sep 17 00:00:00 2001 From: Dillon Flamand Date: Wed, 28 Mar 2018 21:36:53 -0700 Subject: [PATCH 273/292] Improve git auto-correct Provide more details for the git feature auto-correct. --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a5c01cb..3c354be 100644 --- a/README.md +++ b/README.md @@ -974,7 +974,9 @@ Some useful aliases include: *Some Aliases are taken from [@mathiasbynens](https://github.com/mathiasbynens) dotfiles: https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig* #### Auto-Correct -If you type `git comit` you will get this: +Git gives suggestions for misspelled commands and if auto-correct is enabled the command can be fixed and executed automatically. Auto-correct is enabled by specifying an integer which is the delay in tenths of a second before git will run the corrected command. Zero is the default value where no correcting will take place, and a negative value will run the corrected command with no delay. + +For example, if you type `git comit` you will get this: ```bash $ git comit -m "Message" @@ -984,21 +986,23 @@ $ git comit -m "Message" # commit ``` -To call `commit` when `comit` is typed, just enable auto-correct: +Auto-correct can be enabled like this (with a 1.5 second delay): ```bash -$ git config --global help.autocorrect 1 +$ git config --global help.autocorrect 15 ``` -So now you will get this: +So now the command `git comit` will be auto-corrected to `git commit` like this: ```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... +# in 1.5 seconds automatically... ``` +The delay before git will rerun the command is so the user has time to abort. + #### Color To add more color to your Git output: From e59dac618920e23336eb423f636b9a1ef3907586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Will=20=E4=BF=9D=E5=93=A5?= Date: Tue, 1 May 2018 15:50:42 +0800 Subject: [PATCH 274/292] Fix a error Markdown format in Aliases section This commit fixes #187 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5c01cb..406f592 100644 --- a/README.md +++ b/README.md @@ -967,7 +967,7 @@ Some useful aliases include: | `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 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 --"` | From 63f4c2b12eaceca2be78da9baace43b294602c4f Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 1 May 2018 16:46:57 +0800 Subject: [PATCH 275/292] Fix Aliases Markdown format for other translations --- README.ja.md | 3 +-- README.ko.md | 2 +- README.zh-cn.md | 2 +- README.zh-tw.md | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.ja.md b/README.ja.md index f41fd2b..1f19a4d 100644 --- a/README.ja.md +++ b/README.ja.md @@ -929,8 +929,7 @@ $ git config --global alias.ac 'add -A . && 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 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 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 --"` | diff --git a/README.ko.md b/README.ko.md index c2420f9..ebbfdab 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1021,7 +1021,7 @@ $ git config --global alias.ac 'add -A . && 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 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 --"` | diff --git a/README.zh-cn.md b/README.zh-cn.md index 6ad60e5..b715c96 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -861,7 +861,7 @@ $ git config --global alias.ac 'add -A . && 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 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 --"` | diff --git a/README.zh-tw.md b/README.zh-tw.md index 241f6bd..98b7160 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -905,7 +905,7 @@ $ git config --global alias.ac 'add -A . && 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 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 --"` | From affe6ce57ff942ca99b0faea68905cc75a1e9dd5 Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 1 May 2018 23:19:51 +0800 Subject: [PATCH 276/292] Fix Markdown format, the right way! Ref: https://github.github.com/gfm/#example-193 --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 2 +- README.zh-tw.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.ja.md b/README.ja.md index 1f19a4d..7339e57 100644 --- a/README.ja.md +++ b/README.ja.md @@ -929,7 +929,7 @@ $ git config --global alias.ac 'add -A . && 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 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 --"` | diff --git a/README.ko.md b/README.ko.md index ebbfdab..c35ed2c 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1021,7 +1021,7 @@ $ git config --global alias.ac 'add -A . && 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 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 --"` | diff --git a/README.md b/README.md index 406f592..011de0f 100644 --- a/README.md +++ b/README.md @@ -967,7 +967,7 @@ Some useful aliases include: | `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 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 --"` | diff --git a/README.zh-cn.md b/README.zh-cn.md index b715c96..398dd21 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -861,7 +861,7 @@ $ git config --global alias.ac 'add -A . && 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 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 --"` | diff --git a/README.zh-tw.md b/README.zh-tw.md index 98b7160..22bd9da 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -905,7 +905,7 @@ $ git config --global alias.ac 'add -A . && 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 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 --"` | From 4aaff15b6827113789d1bb23136512ad05789cee Mon Sep 17 00:00:00 2001 From: Stefan Peters Date: Thu, 9 Aug 2018 13:26:42 +0200 Subject: [PATCH 277/292] Fix mistake in Closing Issues via Commit Messages The issue will be closed as soon as the commit is committed to the **repository's default branch**, not the master branch. I noticed this because we're using a different default branch for one of our projects. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c1dcfaf..4afcde8 100644 --- a/README.md +++ b/README.md @@ -256,7 +256,7 @@ https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L ![Line Highlighting](http://i.imgur.com/8AhjrCz.png) ### Closing Issues via Commit Messages -If a particular commit fixes an issue, any of the keywords `fix/fixes/fixed`, `close/closes/closed` or `resolve/resolves/resolved`, followed by the issue number, will close the issue once it is committed to the master branch. +If a particular commit fixes an issue, any of the keywords `fix/fixes/fixed`, `close/closes/closed` or `resolve/resolves/resolved`, followed by the issue number, will close the issue once it is committed to the repository's default branch. ```bash $ git commit -m "Fix screwup, fixes #12" From 52ba3a7856683896f6c3b1e8c1d618c842cc57bd Mon Sep 17 00:00:00 2001 From: Tim Green Date: Fri, 10 Aug 2018 10:46:36 +0100 Subject: [PATCH 278/292] remove 512 link --- README.ja.md | 1 - README.ko.md | 1 - README.md | 1 - README.zh-cn.md | 1 - README.zh-tw.md | 1 - 5 files changed, 5 deletions(-) diff --git a/README.ja.md b/README.ja.md index 7339e57..a23ca57 100644 --- a/README.ja.md +++ b/README.ja.md @@ -978,7 +978,6 @@ $ git config --global color.ui 1 | Official Git Tutorial | http://git-scm.com/docs/gittutorial | | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | -| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | | 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 | diff --git a/README.ko.md b/README.ko.md index c35ed2c..d67cc8d 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1075,7 +1075,6 @@ $ git config --global color.ui 1 | Official Git Tutorial | http://git-scm.com/docs/gittutorial | | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | -| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | | 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 | https://training.github.com/kit/ | diff --git a/README.md b/README.md index 4afcde8..6eb4821 100644 --- a/README.md +++ b/README.md @@ -1023,7 +1023,6 @@ $ git config --global color.ui 1 | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | | Git God | https://github.com/gorosgobe/git-god | -| Ry's Git Tutorial | http://rypress.com/tutorials/git/index | | 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 | https://training.github.com/kit/ | diff --git a/README.zh-cn.md b/README.zh-cn.md index a63b39d..dece7be 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -910,7 +910,6 @@ $ git config --global color.ui 1 | Official Git Tutorial | http://git-scm.com/docs/gittutorial | | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | -| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | | 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 | diff --git a/README.zh-tw.md b/README.zh-tw.md index b2471c1..c273bfc 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -954,7 +954,6 @@ $ git config --global color.ui 1 | Official Git Tutorial | http://git-scm.com/docs/gittutorial | | Everyday Git | http://git-scm.com/docs/everyday | | Git Immersion | http://gitimmersion.com/ | -| Ry's Git Tutorial | http://rypress.com/tutorials/git/index.html | | 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 | From ec0a89f23568d96de68e0085b83c80ea147983e2 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Thu, 20 Sep 2018 14:19:45 +0100 Subject: [PATCH 279/292] remove 404 link --- README.ja.md | 2 +- README.ko.md | 2 +- README.md | 2 +- README.zh-cn.md | 2 +- README.zh-tw.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.ja.md b/README.ja.md index a23ca57..050c863 100644 --- a/README.ja.md +++ b/README.ja.md @@ -81,7 +81,7 @@ 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)と[Operaの拡張](https://addons.opera.com/en/extensions/details/github-tab-size/)をインストールすることにより、対応することができる。 +差分やファイルを表示している時、URLに`?ts=4`を追加するとタブを空白4つの幅で表示する。デフォルトは8つだ。`ts`に指定した数で表示されるということだ。これはGistやrawファイルを表示している時には適用されないが、[Chrome](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)をインストールすることにより、対応することができる。 例えばGoのソースファイルを表示している時、`?ts=4`を追加する前はこのように表示されるが: diff --git a/README.ko.md b/README.ko.md index d67cc8d..0503a89 100644 --- a/README.ko.md +++ b/README.ko.md @@ -88,7 +88,7 @@ Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다 ### Adjust Tab Space -diff나 파일 URL에 `?ts=4`를 덧붙이면 탭 문자의 크기를 기본값인 공백 8개 대신 4개로 보여줍니다. `ts` 뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw 파일 보기에는 적용 되지 않습니다만, [크롬 확장 프로그램](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)이나 [오페라 확장 프로그램](https://addons.opera.com/en/extensions/details/github-tab-size/)으로 자동화 할 수 있습니다. +diff나 파일 URL에 `?ts=4`를 덧붙이면 탭 문자의 크기를 기본값인 공백 8개 대신 4개로 보여줍니다. `ts` 뒤의 숫자는 설정에 맞게 변경 하실 수 있습니다. gist나 raw 파일 보기에는 적용 되지 않습니다만, [크롬 확장 프로그램](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)이나 으로 자동화 할 수 있습니다. 여기에 있는 Go 소스 파일은 `?ts=4`를 붙이기 전에는 이렇습니다. diff --git a/README.md b/README.md index 6eb4821..d490785 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Adding `?w=1` to any diff URL will remove any changes only in whitespace, enabli [*Read more about GitHub secrets.*](https://github.com/blog/967-github-secrets) ### Adjust Tab Space -Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome](https://chrome.google.com/webstore/detail/tab-size-on-github/ofjbgncegkdemndciafljngjbdpfmbkn) or [Opera extension](https://addons.opera.com/en/extensions/details/github-tab-size/) can automate this. +Adding `?ts=4` to a diff or file URL will display tab characters as 4 spaces wide instead of the default 8. The number after `ts` can be adjusted to suit your preference. This does not work on Gists, or raw file views, but a [Chrome extension](https://chrome.google.com/webstore/detail/tab-size-on-github/ofjbgncegkdemndciafljngjbdpfmbkn) can automate this. Here is a Go source file before adding `?ts=4`: diff --git a/README.zh-cn.md b/README.zh-cn.md index dece7be..9a28341 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -75,7 +75,7 @@ Git 和 Github 秘籍,灵感来自于 [Zach Holman](https://github.com/holman) [*详见 GitHub secrets.*](https://github.com/blog/967-github-secrets) ### 调整 Tab 字符所代表的空格数 -在 diff 或文件的 URL 后面加上 `?ts=4` ,这样当显示 tab 字符的长度时就会是 4 个空格的长度,不再是默认的 8 个空格。 `ts` 后面的数字还可以根据你个人的偏好进行修改。这个技巧不适用于 Gists,或者以 Raw 格式查看文件, 但有浏览器扩展插件可以帮你自动调整: [Chrome 扩展](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) , [Opera 扩展](https://addons.opera.com/en/extensions/details/github-tab-size/)。 +在 diff 或文件的 URL 后面加上 `?ts=4` ,这样当显示 tab 字符的长度时就会是 4 个空格的长度,不再是默认的 8 个空格。 `ts` 后面的数字还可以根据你个人的偏好进行修改。这个技巧不适用于 Gists,或者以 Raw 格式查看文件, 但有浏览器扩展插件可以帮你自动调整: [Chrome 扩展](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)。 下面以一个 Go 语言源文件为例,看看在 URL 里添加 `?ts=4` 参数的效果。添加前: diff --git a/README.zh-tw.md b/README.zh-tw.md index c273bfc..cfc43c2 100644 --- a/README.zh-tw.md +++ b/README.zh-tw.md @@ -77,7 +77,7 @@ Git 和 Github 秘笈,靈感來自於 [Zach Holman](https://github.com/holman) [*詳見 GitHub secrets.*](https://github.com/blog/967-github-secrets) ### 調整 Tab 字串所代表的空格數 -在 diff 或文件的 URL 後面加上 `?ts=4` ,這樣當顯示 tab 字串的長度時就會是 4 個空格的長度,不再是默認的 8 個空格。 `ts` 後面的數字還可以根據你個人的偏好進行修改。這個技巧不適用於 Gists,或者以 Raw 格式查看文件, 但有瀏覽器擴展插件可以幫你自動調整: [Chrome 擴展](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn) , [Opera 擴展](https://addons.opera.com/en/extensions/details/github-tab-size/)。 +在 diff 或文件的 URL 後面加上 `?ts=4` ,這樣當顯示 tab 字串的長度時就會是 4 個空格的長度,不再是默認的 8 個空格。 `ts` 後面的數字還可以根據你個人的偏好進行修改。這個技巧不適用於 Gists,或者以 Raw 格式查看文件, 但有瀏覽器擴展插件可以幫你自動調整: [Chrome 擴展](https://chrome.google.com/webstore/detail/github-tab-size/ofjbgncegkdemndciafljngjbdpfmbkn)。 下面以一個 Go 語言原始碼為例,看看在 URL 裡添加 `?ts=4` 參數的效果。添加前: From 8b8a98d86a76ba825592964698e105ca5140fd5f Mon Sep 17 00:00:00 2001 From: Eyar Zilberman Date: Mon, 18 Mar 2019 18:15:37 +0200 Subject: [PATCH 280/292] Add GitHub Resources - GitHub Best Practices --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d490785..143211b 100644 --- a/README.md +++ b/README.md @@ -646,6 +646,7 @@ If you are a student you will be eligible for the GitHub Student Developer Pack. | GitHub Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | | Github Education (Free Micro Account and other stuff for students) | https://education.github.com/ | +| GitHub Top 10 Best Practices | [Best Practices List](https://datree.io/blog/top-10-github-best-practices/) | #### GitHub Talks | Title | Link | From ad15b718f2ffe248e5e1e40b6693e05c5d5ee7dd Mon Sep 17 00:00:00 2001 From: Shahbaz Khan <36714405+SKhan97@users.noreply.github.com> Date: Tue, 18 Jun 2019 19:09:15 +0100 Subject: [PATCH 281/292] Added Repository templates section New feature that allows a repository to be used as a template --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 143211b..1d4c099 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Git Books](#git-books) - [Git Videos](#git-videos) - [Git Articles](#git-articles) + -[Repository Templates](#repository-templates) ## GitHub ### Ignore Whitespace @@ -669,6 +670,19 @@ e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) [*Read more about accessing public ssh keys.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) +### Repository Templates + +You can set your repository to template which allows anyone to copy the files and structure and allowing them to instantly use the files (e.g. for a tutorial or if writing boilerplate code). + +This is done by going into settings for your repository and changing it to a template one +![Convert](https://i.postimg.cc/hGCrVm9F/Template.gif) + +Changing to a template repository will give a new URL endpoint which can be shared and instantly allows users to use your repository as a template. Alternatively, they can go to your repository and click the 'Use as template' button. + +![Template](https://i.postimg.cc/L8PKCHx0/New-Template.gif) + +[*Read more about using repositories as templates*](https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/) + ## Git ### Remove All Deleted Files from the Working Tree When you delete a lot of files using `/bin/rm` you can use the following command to remove them from the working tree and from the index, eliminating the need to remove each one individually: From 59b710c24a34fadeb9f45897d59b450ff1dde377 Mon Sep 17 00:00:00 2001 From: Shahbaz Khan <36714405+SKhan97@users.noreply.github.com> Date: Tue, 18 Jun 2019 19:10:44 +0100 Subject: [PATCH 282/292] Adding repository templates to contents --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d4c099..63b53d2 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [SSH keys](#ssh-keys) + - [Repository Templates](#repository-templates) - [Git](#git) - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - [Previous Branch](#previous-branch) @@ -76,7 +77,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Git Books](#git-books) - [Git Videos](#git-videos) - [Git Articles](#git-articles) - -[Repository Templates](#repository-templates) + ## GitHub ### Ignore Whitespace From db89d93a6c03aef5cfcf2c2e6340aeb0422c158b Mon Sep 17 00:00:00 2001 From: Tim Green Date: Tue, 18 Jun 2019 19:22:24 +0100 Subject: [PATCH 283/292] update wording --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 63b53d2..548375b 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [SSH keys](#ssh-keys) - - [Repository Templates](#repository-templates) + - [Repository Templates](#repository-templates) - [Git](#git) - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) - [Previous Branch](#previous-branch) @@ -77,7 +77,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [Git Books](#git-books) - [Git Videos](#git-videos) - [Git Articles](#git-articles) - + ## GitHub ### Ignore Whitespace @@ -673,9 +673,8 @@ e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) ### Repository Templates -You can set your repository to template which allows anyone to copy the files and structure and allowing them to instantly use the files (e.g. for a tutorial or if writing boilerplate code). +You can enable templating on your repository which allows anyone to copy the directory structure and files, allowing them to instantly use the files (e.g. for a tutorial or if writing boilerplate code). This can be enabled in the settings of your repository. -This is done by going into settings for your repository and changing it to a template one ![Convert](https://i.postimg.cc/hGCrVm9F/Template.gif) Changing to a template repository will give a new URL endpoint which can be shared and instantly allows users to use your repository as a template. Alternatively, they can go to your repository and click the 'Use as template' button. From f8a316ea2a4be6c0c0044e053c3e5bd56c47478f Mon Sep 17 00:00:00 2001 From: Daniel Brown Date: Sun, 2 Feb 2020 16:41:57 +0100 Subject: [PATCH 284/292] update description of search box --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 548375b..b5ca751 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ When on a repository page, keyboard shortcuts allow you to navigate easily. - Pressing `t` will bring up a file explorer. - Pressing `w` will bring up the branch selector. - - Pressing `s` will focus the search field for the current repository. Pressing Backspace to delete the “This repository” pill changes the field to search all of GitHub. + - Pressing `s` will focus the search field for the current repository. Pressing ↓ to select the “All GitHub” option changes the field to search all of GitHub. - Pressing `l` will edit labels on existing Issues. - 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. From 789009d845a46e9ed36a12632e9707b46220fa0a Mon Sep 17 00:00:00 2001 From: Daniel Brown Date: Sun, 2 Feb 2020 16:49:13 +0100 Subject: [PATCH 285/292] remove unavailable "GitHub Top 10 Best Practices" --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 548375b..d0e1cef 100644 --- a/README.md +++ b/README.md @@ -648,7 +648,6 @@ If you are a student you will be eligible for the GitHub Student Developer Pack. | GitHub Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | | Github Education (Free Micro Account and other stuff for students) | https://education.github.com/ | -| GitHub Top 10 Best Practices | [Best Practices List](https://datree.io/blog/top-10-github-best-practices/) | #### GitHub Talks | Title | Link | From 1161f5e4d1f3e0910ab49e52768383f3204b17b0 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Thu, 25 Jun 2020 17:17:03 +0100 Subject: [PATCH 286/292] Create FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..6da6f74 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [tiimgreen] From 9047a18c5866edecaa8dccf4277fd1eb0f59047c Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 14 Aug 2020 19:02:36 -0400 Subject: [PATCH 287/292] Add section for "Profile Image" --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 548375b..5d26bec 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c - [GitHub Resources](#github-resources) - [GitHub Talks](#github-talks) - [SSH keys](#ssh-keys) + - [Profile Image](#profile-image) - [Repository Templates](#repository-templates) - [Git](#git) - [Remove All Deleted Files from the Working Tree](#remove-all-deleted-files-from-the-working-tree) @@ -671,6 +672,16 @@ e.g. [https://github.com/tiimgreen.keys](https://github.com/tiimgreen.keys) [*Read more about accessing public ssh keys.*](https://changelog.com/github-exposes-public-ssh-keys-for-its-users/) +### Profile Image + +You can get a user's profile image by visiting: + +``` +https://github.com/{user}.png +``` + +e.g. [https://github.com/tiimgreen.png](https://github.com/tiimgreen.png) + ### Repository Templates You can enable templating on your repository which allows anyone to copy the directory structure and files, allowing them to instantly use the files (e.g. for a tutorial or if writing boilerplate code). This can be enabled in the settings of your repository. From b42e1f38a6d1df988b09347cd7be29415d51dcce Mon Sep 17 00:00:00 2001 From: Tim Green Date: Mon, 5 Oct 2020 13:33:54 +0100 Subject: [PATCH 288/292] fix broken links --- README.ko.md | 3 +-- README.md | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.ko.md b/README.ko.md index 0503a89..0116ba3 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,6 +1,6 @@ # GitHub 치트 시트 [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) -Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://confreaks.tv/videos/aloharuby2012-git-and-github-secrets)([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))과 WDCNZ 2013에서 발표한 [Git과 GitHub에 대한 더 많은 비밀들](https://vimeo.com/72955426)([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. +Git과 GitHub에서 꽤 유용하지만 숨겨져 있는 기능들에 대해 다룹니다. 이 치트 시트는 [Zach Holman](https://github.com/holman)이 Aloha Ruby Conference 2012에서 발표한 [Git과 GitHub의 비밀들](http://confreaks.tv/videos/aloharuby2012-git-and-github-secrets) ([슬라이드](https://speakerdeck.com/holman/git-and-github-secrets))과 WDCNZ 2013에서 발표한 [Git과 GitHub에 대한 더 많은 비밀들](https://vimeo.com/72955426) ([슬라이드](https://speakerdeck.com/holman/more-git-and-github-secrets))에서 영감을 받아 작성되었습니다. *단축주소: [`http://git.io/sheet`](http://git.io/sheet)* @@ -1077,7 +1077,6 @@ $ git config --global color.ui 1 | 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 | https://training.github.com/kit/ | | Git Visualization Playground | http://onlywei.github.io/explain-git-with-d3/#freeplay | | Learn Git Branching | http://pcottle.github.io/learnGitBranching/ | | A collection of useful .gitignore templates | https://github.com/github/gitignore | diff --git a/README.md b/README.md index 6a72230..7d99555 100644 --- a/README.md +++ b/README.md @@ -1051,7 +1051,6 @@ $ git config --global color.ui 1 | Git God | https://github.com/gorosgobe/git-god | | 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 | https://training.github.com/kit/ | | Git Visualization Playground | http://onlywei.github.io/explain-git-with-d3/#freeplay | | Learn Git Branching | http://pcottle.github.io/learnGitBranching/ | | A collection of useful .gitignore templates | https://github.com/github/gitignore | From 02f4cada4c1bbb3538212c9fe1dacbc93692a9b9 Mon Sep 17 00:00:00 2001 From: Daniel Brown Date: Mon, 5 Oct 2020 15:11:09 +0200 Subject: [PATCH 289/292] Update README.md add updated "GitHub Best Practices" to GitHub Resources --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d0e1cef..a5d4a9b 100644 --- a/README.md +++ b/README.md @@ -648,6 +648,7 @@ If you are a student you will be eligible for the GitHub Student Developer Pack. | GitHub Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | | Github Education (Free Micro Account and other stuff for students) | https://education.github.com/ | +| GitHub Best Practices | [Best Practices List](https://www.datree.io/resources/github-best-practices) | #### GitHub Talks | Title | Link | From f1267b5e8592c364e3844d5d12bda50da2558cbd Mon Sep 17 00:00:00 2001 From: Daniel Brown Date: Mon, 5 Oct 2020 15:13:02 +0200 Subject: [PATCH 290/292] remove whitespace (tab) after line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5d4a9b..5e67c4a 100644 --- a/README.md +++ b/README.md @@ -648,7 +648,7 @@ If you are a student you will be eligible for the GitHub Student Developer Pack. | GitHub Training | https://training.github.com/ | | GitHub Developer | https://developer.github.com/ | | Github Education (Free Micro Account and other stuff for students) | https://education.github.com/ | -| GitHub Best Practices | [Best Practices List](https://www.datree.io/resources/github-best-practices) | +| GitHub Best Practices | [Best Practices List](https://www.datree.io/resources/github-best-practices) | #### GitHub Talks | Title | Link | From cd5e46c9f582f96d883a78f977904d799444e4ed Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sat, 28 May 2022 16:35:12 -0500 Subject: [PATCH 291/292] add sponsor --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 280bb62..9f70885 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c *Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* +GitHub Cheat Sheet is sponsored by [Drawpoint: create interactive maps and images for your website with no coding](https://www.drawpoint.io) + ## Table of Contents - [GitHub](#github) - [Ignore Whitespace](#ignore-whitespace) From 746af1b42356973f66627319bbaf4ac5157c5308 Mon Sep 17 00:00:00 2001 From: Tim Green Date: Sun, 15 Oct 2023 15:26:25 +0100 Subject: [PATCH 292/292] change sponsor --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f70885..6b8c9ae 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A collection of cool hidden and not so hidden features of Git and GitHub. This c *Read this in other languages: [English](README.md), [한국어](README.ko.md), [日本語](README.ja.md), [简体中文](README.zh-cn.md), [正體中文](README.zh-tw.md).* -GitHub Cheat Sheet is sponsored by [Drawpoint: create interactive maps and images for your website with no coding](https://www.drawpoint.io) +GitHub Cheat Sheet is sponsored by [Snapshot: create interactive professional-quality product photos using AI](https://www.snapshotapp.io/) ## Table of Contents - [GitHub](#github)