mirror of
https://github.com/tiimgreen/github-cheat-sheet.git
synced 2025-08-16 12:53:57 +02:00
Update to e81076bd26
This commit is contained in:
713
README.ko.md
713
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,7 +74,297 @@ $ git clone https://github.com/tiimgreen/github-cheat-sheet
|
||||
|
||||
[*깃 `clone` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-clone)
|
||||
|
||||
## Hub - Git Wrapper
|
||||
### 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
|
||||
```
|
||||
|
||||
이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다.
|
||||
|
||||
[*시간으로 커밋을 비교하는 법에 대해 더 읽어 보세요.*](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
|
||||
```
|
||||
|
||||
### Gists
|
||||
|
||||
[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다. [이렇게](https://gist.github.com/tiimgreen/10545817.pibb) Gist URL뒤에 `.pibb`를 넣으면 다른 사이트에 넣을수 있는 *HTML 온리* 버전을 넣을 수 있습니다.
|
||||
|
||||
Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다.
|
||||
|
||||
```bash
|
||||
$ git clone https://gist.github.com/tiimgreen/10545817
|
||||
```
|
||||
|
||||

|
||||
|
||||
[*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists)
|
||||
|
||||
### Git.io
|
||||
|
||||
[Git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. 순수 HTTP에서 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)
|
||||
|
||||
### Keyboard Shortcuts
|
||||
|
||||
저장소 페이지에서 단축키를 사용하면 쉽게 이동할 수 있습니다.
|
||||
|
||||
- `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)
|
||||
|
||||
### Line Highlighting in Repos
|
||||
|
||||
코드 파일 URL의 끝에 `#L52`를 추가하거나 줄 번호를 클릭하면 그 줄 번호를 하이라이트합니다.
|
||||
|
||||
`#L53-L60`처럼 범위지정도 가능합니다. 범위를 지정하려면 `shift`키를 누른 채 두 라인을 클릭하면 됩니다.
|
||||
|
||||
```
|
||||
https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Closing Issues with Commits
|
||||
|
||||
어떤 커밋이 이슈를 고쳤다면, `fix/fixes/fixed`나 `close/closes/closed`를 키워드로 해당 이슈가 마스터 브랜치에 커밋 될 때 닫을 수 있습니다.
|
||||
|
||||
```bash
|
||||
$ git commit -m "Fix cock up, fixes #12"
|
||||
```
|
||||
|
||||
이렇게 하면 이슈를 닫고 클로징 커맨트로 참조하게 합니다.
|
||||
|
||||

|
||||
|
||||
[*커밋 메세지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages)
|
||||
|
||||
### 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)을 정독하시면 어떤 키워드가 유효한지 확인하실 수 있습니다.
|
||||
|
||||
[*깃허브 Flavored 마크다운에 대해 더 읽어 보세요.*](https://help.github.com/articles/github-flavored-markdown)
|
||||
|
||||
### 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를 넣을 수 있습니다.
|
||||
|
||||
```
|
||||

|
||||
```
|
||||
|
||||

|
||||
|
||||
모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다.
|
||||
|
||||
#### Embedding Images in GitHub Wiki
|
||||
|
||||
이미지를 위키 페이지ㅇ넣는 방법은 여럿 있습니다. 위에 보이는 일반 마크다운 문법도 있지만, 이미지에 높이와 넓이를 지정할 수 있는 문법도 있습니다.
|
||||
|
||||
```markdown
|
||||
[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]]
|
||||
```
|
||||
|
||||
이렇게 보입니다.
|
||||
|
||||

|
||||
|
||||
### Quick Quoting
|
||||
|
||||
스레드에 답글들 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다.
|
||||
|
||||

|
||||
|
||||
[*빠른 인용에 대해 더 읽어 보세요.*](https://github.com/blog/1399-quick-quotes)
|
||||
|
||||
### Quick Licensing
|
||||
|
||||
저장소를 만들 때, 깃허브는 만들어진 저작권을 추가할 수 있는 옵션을 제공합니다.
|
||||
|
||||

|
||||
|
||||
이미 있는 저장소에도 웹 인터페이스에서 새 파일을 만들어 추가할 수 있습니다.
|
||||
이름에 `LICENSE`를 입력하면 옵션으로 템플릿을 사용할 수 있습니다.
|
||||
|
||||

|
||||
|
||||
`.gitignore`에도 똑같이 적용됩니다.
|
||||
|
||||
[*오픈 소스 저작권에 대해 더 읽어 보세요.*](https://help.github.com/articles/open-source-licensing)
|
||||
|
||||
### Task Lists
|
||||
|
||||
이슈와 풀 리퀘스트에서 밑의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.)
|
||||
|
||||
```
|
||||
- [ ] Be awesome
|
||||
- [ ] Do stuff
|
||||
- [ ] Sleep
|
||||
```
|
||||
|
||||

|
||||
|
||||
체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다.
|
||||
|
||||
```
|
||||
- [x] Be awesome
|
||||
- [x] Do stuff
|
||||
- [ ] 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)
|
||||
|
||||
### 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)
|
||||
|
||||
### Diffs
|
||||
|
||||
#### Rendered Prose Diffs
|
||||
|
||||
산문(prose) 파일이 있는 커밋과 풀 리퀘스트는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다.
|
||||
|
||||

|
||||
|
||||
"rendered" 버튼을 클릭하시면 렌더된 문서에서 변경을 확인하실 수 있습니다. 렌더된 산문(prose) 뷰는 문장을 추가, 삭제, 변경했을때 유용합니다.
|
||||
|
||||

|
||||
|
||||
[*렌더된 산문(prose) diff에 대해 더 읽어 보세요.*](https://github.com/blog/1784-rendered-prose-diffs)
|
||||
|
||||
#### Diffable Maps
|
||||
|
||||
지오데이타가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 깃허브는 무엇이 변경 되었는지 시각적으로 보여줍니다.
|
||||
|
||||
[](https://github.com/benbalter/congressional-districts/commit/2233c76ca5bb059582d796f053775d8859198ec5)
|
||||
|
||||
[*diff 가능한 맵에 대해 더 읽어 보세요.*](https://github.com/blog/1772-diffable-more-customizable-maps)
|
||||
|
||||
#### Expanding Context in Diffs
|
||||
|
||||
diff의 닫아둔 곳의 *펼침* 버튼을 클릭하면, 문맥을 더 볼 수 있습니다. 전채 파일을 표시할때까지 계속 *펼칠* 수 있으며, 깃허브에서 diff가 표시되는 장소라면 어디서든 사용가능합니다.
|
||||
|
||||

|
||||
|
||||
[*diff에서의 문맥 확장에 대해 더 읽어 보세요.*](https://github.com/blog/1705-expanding-context-in-diffs)
|
||||
|
||||
### Hub - Git Wrapper
|
||||
|
||||
[Hub](https://github.com/github/hub)는 깃허브를 좀 더 쉽게 사용할 수 있도록 추가 기능 및 명령을 제공하는 커맨드 라인 깃 래퍼입니다.
|
||||
|
||||
@@ -74,7 +382,7 @@ $ hub clone tiimgreen/toc
|
||||
|
||||
[*Hub가 제공하는 더 멋진 기능들을 확인해 보세요.*](https://github.com/github/hub#commands)
|
||||
|
||||
## Decreasing Contributor Friction
|
||||
### Decreasing Contributor Friction
|
||||
|
||||
사람들이 사용하고 기여할 수 있는 프로젝트를 만드려면, 가장 기본적인 질문에 대답할 수 있어야합니다. 이 프로젝트는 무엇입니까? 어떻게 사용합니까? 어디까지 허용됩니까? 어떻게 기여합니까? 어떻게 개발하고 실행해야 합니까? 어떻게 새로운 기능이 이전 기능을 손상되지 않았는지 확인해야 합니까?
|
||||
|
||||
@@ -82,7 +390,17 @@ $ hub clone tiimgreen/toc
|
||||
|
||||
[](https://github.com/rafalchmiel/friction)
|
||||
|
||||
## Previous Branch
|
||||
### Contributing Guidelines
|
||||
|
||||
저장소의 제일 위에 `CONTRIBUTING` 파일을 넣어두면 기여자가 이슈를 만들거나 풀 리퀘스트를 만들 때 링크로 보여줍니다.
|
||||
|
||||

|
||||
|
||||
[*기여하기에 대해 더 읽어 보세요.*](https://github.com/blog/1184-contributing-guidelines)
|
||||
|
||||
## Git
|
||||
|
||||
### Previous Branch
|
||||
|
||||
커맨드 라인에서 이전 디렉터리로 이동하려면 이렇게 합니다.
|
||||
|
||||
@@ -105,69 +423,7 @@ $ git checkout -
|
||||
|
||||
[*깃 브랜치에 대해 더 읽어 보세요.*](http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging)
|
||||
|
||||
## Git.io
|
||||
|
||||
[Git.io](http://git.io)는 깃허브를 위한 간단한 URL 단축기입니다. 순수 HTTP에서 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)
|
||||
|
||||
## Gists
|
||||
|
||||
[Gists](https://gist.github.com/)는 본격적인 저장소를 만들지 않고, 작은 코드 조각과 일할 수 있는 쉬운 방법입니다.
|
||||
|
||||
쉬운 방법이긴 하지만, Gists는 본격적인 저장소처럼 취급할 수 있고 클론도 됩니다.
|
||||
|
||||
```bash
|
||||
$ git clone https://gist.github.com/tiimgreen/10545817
|
||||
```
|
||||
|
||||

|
||||
|
||||
[*gist를 만드는 법에 대해 더 읽어보세요.*](https://help.github.com/articles/creating-gists)
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
저장소 페이지에서 단축키를 사용하면 쉽게 이동할 수 있습니다.
|
||||
|
||||
`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"
|
||||
```
|
||||
|
||||
이렇게 하면 이슈를 닫고 클로징 커맨트로 참조하게 합니다.
|
||||
|
||||

|
||||
|
||||
[*커밋 메세지로 이슈 닫기에 대해 더 읽어 보세요.*](https://help.github.com/articles/closing-issues-via-commit-messages)
|
||||
|
||||
## Checking out Pull Requests
|
||||
### Checking out Pull Requests
|
||||
|
||||
풀 리퀘스트를 체크아웃하려면, 다음 명령어로 가져올 수 있습니다.
|
||||
|
||||
@@ -210,49 +466,7 @@ $ git checkout origin/pr/42
|
||||
|
||||
[*풀 리퀘스트를 로컬로 체크아웃 하는 방법에 대해 더 읽어 보세요.*](https://help.github.com/articles/checking-out-pull-requests-locally)
|
||||
|
||||
## 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)을 정독하시면 어떤 키워드가 유효한지 확인하실 수 있습니다.
|
||||
|
||||
[*깃허브 Flavored 마크다운에 대해 더 읽어 보세요.*](https://help.github.com/articles/github-flavored-markdown)
|
||||
|
||||
## 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)
|
||||
|
||||
## Empty Commits
|
||||
### Empty Commits :trollface:
|
||||
|
||||
`--allow-empty`를 추가하시면 코드의 변경 없이 커밋을 넣을 수 있습니다.
|
||||
|
||||
@@ -260,141 +474,13 @@ https://github.com/rails/rails/commits/master?author=dhh
|
||||
$ git commit -m "Big-ass commit" --allow-empty
|
||||
```
|
||||
|
||||

|
||||
있을 법한 사용법에는 이런 것들이 있습니다.
|
||||
|
||||
## 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
|
||||
```
|
||||
|
||||
이렇게 하면 특정 날짜나 한 시간 전의 마스터 브랜치의 차이를 확인할 수 있습니다.
|
||||
|
||||
[*시간으로 커밋을 비교하는 법에 대해 더 읽어 보세요.*](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`를 추가하거나 줄 번호를 클릭하면 그 줄 번호를 하이라이트합니다.
|
||||
|
||||
`#L53-L60`처럼 범위지정도 가능합니다. 범위를 지정하려면 `shift`키를 누른 채 두 라인을 클릭하면 됩니다.
|
||||
|
||||
```
|
||||
https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60
|
||||
```
|
||||
|
||||

|
||||
|
||||
## 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)
|
||||
|
||||
## Diffs
|
||||
|
||||
### Rendered Prose Diffs
|
||||
|
||||
산문(prose) 파일이 있는 커밋과 풀 리퀘스트는 *source*와 *rendered* 뷰 기능을 사용할 수 있습니다. "rendered" 버튼을 클릭하시면 렌더된 문서에서 변경을 확인하실 수 있습니다. 렌더된 산문(prose) 뷰는 문장을 추가, 삭제, 변경했을때 유용합니다.
|
||||
|
||||

|
||||
|
||||
[*렌더된 산문(prose) diff에 대해 더 읽어 보세요.*](https://github.com/blog/1784-rendered-prose-diffs)
|
||||
|
||||
### Diffable Maps
|
||||
|
||||
지오데이타가 포함된 커밋이나 풀 리퀘스트를 볼 때마다 깃허브는 무엇이 변경 되었는지 시각적으로 보여줍니다.
|
||||
|
||||
[](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.
|
||||
|
||||

|
||||
|
||||
[*diff에서의 문맥 확장에 대해 더 읽어 보세요.*](https://github.com/blog/1705-expanding-context-in-diffs)
|
||||
|
||||
## 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를 넣을 수 있습니다.
|
||||
|
||||
```
|
||||

|
||||
```
|
||||
|
||||

|
||||
|
||||
모든 이미지는 GitHub에서 케쉬합니다. 그래서 호스트가 죽어도 이미지는 여전히 남습니다.
|
||||
|
||||
## Quick Quoting
|
||||
|
||||
스레드에 답글들 때 전에 누가 말한 어떤 내용을 인용하고 싶다면, 텍스트를 하이라이트하고 `r`을 누르세요. 이렇게 하면 내용을 텍스트 박스에 인용 포맷으로 복사해 줍니다.
|
||||
|
||||

|
||||
|
||||
[*빠른 인용에 대해 더 읽어 보세요.*](https://github.com/blog/1399-quick-quotes)
|
||||
|
||||
## Styled Git Status
|
||||
### 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`과 로컬 저장소를 브라우징 하기 위한 웹 서버를 설정하는 스크립트입니다.
|
||||
|
||||

|
||||
|
||||
이미 있는 저장소에도 웹 인터페이스에서 새 파일을 만들어 추가할 수 있습니다.
|
||||
이름에 `LICENSE`를 입력하면 옵션으로 템플릿을 사용할 수 있습니다.
|
||||
|
||||

|
||||
|
||||
`.gitignore`에도 똑같이 적용됩니다.
|
||||
|
||||
[*오픈 소스 저작권에 대해 더 읽어 보세요.*](https://help.github.com/articles/open-source-licensing)
|
||||
|
||||
## Task Lists
|
||||
|
||||
이슈와 풀 리퀘스트에서 밑의 문법으로 체크박스를 넣을 수 있습니다.(스페이스에 주의하세요.)
|
||||
|
||||
```
|
||||
- [ ] Be awesome
|
||||
- [ ] Do stuff
|
||||
- [ ] Sleep
|
||||
```bash
|
||||
$ git instaweb
|
||||
```
|
||||
|
||||

|
||||
Opens:
|
||||
|
||||
체크박스가 클릭 되면, 순수 마크다운에서 갱신이 이루어집니다.
|
||||

|
||||
|
||||
```
|
||||
- [x] Be awesome
|
||||
- [x] Do stuff
|
||||
- [ ] Sleep
|
||||
```
|
||||
[*깃 `instaweb` 커맨드에 대해 더 읽어 보세요.*](http://git-scm.com/docs/git-instaweb)
|
||||
|
||||
[*테스크 리스트에 대해 더 읽어 보세요.*](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
|
||||
### 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시트)에 공유하기
|
||||
|
Reference in New Issue
Block a user