diff --git a/BASE.md b/BASE.md index 0c3d6337..ae6bf786 100644 --- a/BASE.md +++ b/BASE.md @@ -1 +1 @@ -progit/progit2@98c409c69dfbfbdffdc4b6dd083940638d2dcb6e +progit/progit2@63e4c6230b22211ab6c83f7e0351e276becd2fa2 diff --git a/book/01-introduction/sections/first-time-setup.asc b/book/01-introduction/sections/first-time-setup.asc index 4206afb1..51974aae 100644 --- a/book/01-introduction/sections/first-time-setup.asc +++ b/book/01-introduction/sections/first-time-setup.asc @@ -41,11 +41,14 @@ Each level overrides values in the previous level, so values in `.git/config` tr ////////////////////////// On Windows systems, Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people). It also still looks for `/etc/gitconfig`, although it's relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer. -However, if you are using Git for Windows 2.x, it is `C:\Documents and Settings\All Users\Application Data\Git\config` on Windows XP, and it is `C:\ProgramData\Git\config` on Windows Vista and newer. +If you are using Git for Windows 2.x or later, there is also a system-level config file at +`C:\Documents and Settings\All Users\Application Data\Git\config` on Windows XP, and in `C:\ProgramData\Git\config` on Windows Vista and newer. +This config file can only be changed by `git config -f ` as an admin. ////////////////////////// 윈도에서는 `$HOME` 디렉토리에서 `.gitconfig` 파일을 찾는다(아마도 `C:\Users\$USER` 디렉토리). 윈도에서도 `/etc/gitconfig` 파일은 그 경로에서 찾는다. 이 경로는 아마도 MSys 루트의 상대경로일 텐데, MSys 루트는 인스톨러로 Git을 윈도에 설치할 때 결정된다. 'Git for Windows' 2.x 버전에서는 조금 다르다. 윈도 XP 사용자는 `C:\Documents and Settings\All Users\Application Data\Git\config` 디렉토리에서 찾을 수 있고 윈도 Vista 이후 버전 사용자는 `C:\ProgramData\Git\config`에서 찾을 수 있다. +이 시스템 설정 파일의 경로는 `git config -f ` 명령으로 변경할 수 있다. 관리자 권한이 필요하다. ////////////////////////// ==== Your Identity @@ -84,11 +87,11 @@ GUI 도구들은 처음 실행할 때 이 설정을 묻는다. ////////////////////////// Now that your identity is set up, you can configure the default text editor that will be used when Git needs you to type in a message. -If not configured, Git uses your system's default editor, which is generally Vim. +If not configured, Git uses your system's default editor, which is system dependant. If you want to use a different text editor, such as Emacs, you can do the following: ////////////////////////// 사용자 정보를 설정하고 나면 Git에서 사용할 텍스트 편집기를 고른다. -기본적으로 Git은 시스템의 기본 편집기를 사용하고 보통 Vi나 Vim이다. +기본적으로 Git은 시스템의 기본 편집기를 사용해서 시스템마다 다르다. 하지만, Emacs 같은 다른 텍스트 편집기를 사용할 수 있고 아래와 같이 실행하면 된다. [source,console] @@ -96,16 +99,53 @@ If you want to use a different text editor, such as Emacs, you can do the follow $ git config --global core.editor emacs ---- +////////////////////////// +While on a Windows system, if you want to use a different text editor, such as Notepad++, you can do the following: +////////////////////////// +윈도 사용자라면 다른 텍스트 편집기를 사용할 수 있다. 아래는 Notepad++를 사용하는 설정이다. + +////////////////////////// +On a x86 system +////////////////////////// +x86 시스템 + +[source,console] +---- +$ git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -nosession" +---- + +////////////////////////// +On a x64 system +////////////////////////// +x64 시스템 + +[source,console] +---- +$ git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -nosession" +---- + +[NOTE] +////////////////////////// +==== +Vim, Emacs and Notepad++ are popular text editors often used by developers on Unix based systems like Linux and OS X or a Windows system. +If you are not familiar with either of these editors, you may need to search for specific instructions for how to set up your favorite editor with Git. +==== +////////////////////////// +==== +Vim과 Emacs, Notepad++은 꽤 인기 있는 편집기로 개발자들이 즐겨 사용한다. OS X나 Linux 같은 Unix 시스템이나 윈도 시스템에서 사용 가능하다. +이 편집기가 불편해서 다른 편집기를 사용해야 한다면 Git 편집기로 설정하는 방법을 찾아봐야 한다. +==== + [WARNING] ////////////////////////// -Vim and Emacs are popular text editors often used by developers on Unix based systems like Linux and Mac. -If you are not familiar with either of these editors or are on a Windows system, you may need to search for instructions for how to set up your favorite editor with Git. -If you don't set an editor like this and you don't know what Vim or Emacs are, you will likely get into a really confusing state when they are launched. +==== +You may find, if you don't setup an editor like this, you will likely get into a really confusing state when they are launched. +Such example on a Windows system may include a prematurely terminated Git operation during a Git initiated edit. +==== ////////////////////////// ==== -Vim과 Emacs는 Mac과 Linux같은 Unix 시스템에서 개발자에게 꽤 인기있는 편집기다. -이 편집기가 불편하거나 윈도를 사용하거나 해서 다른 편집기를 사용해야 한다면 Git 편집기로 설정하는 방법을 찾아봐야 한다. -Vim이나 Emacs을 사용할 줄 모르고 다른 편집기로 설정하지도 못했는데 갑자기 실행되면 정말 멘붕이다. +자신의 편집기를 설정하지 않으면 갑자기 실행된 편집기에 당황할 수 있다. +그땐 당황하지 말고 편집기를 그냥 종료하면 Git 명령을 취소할 수 있다. ==== ////////////////////////// diff --git a/book/01-introduction/sections/installing.asc b/book/01-introduction/sections/installing.asc index 2e41b429..6d8db090 100644 --- a/book/01-introduction/sections/installing.asc +++ b/book/01-introduction/sections/installing.asc @@ -33,7 +33,7 @@ Git은 정말 이전 버전과 잘 호환되도록 유지하기 때문에 2.0 (((Linux, installing))) ////////////////////////// -If you want to install Git on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution. +If you want to install the basic Git tools on Linux via a binary installer, you can generally do so through the basic package-management tool that comes with your distribution. If you're on Fedora for example, you can use yum: ////////////////////////// Linux에서 패키지로 Git을 설치할 때에는 보통 각 배포판에서 사용하는 패키지 관리도구를 사용하여 설치한다. @@ -41,7 +41,7 @@ Fedora에서는 아래와 같이 한다. [source,console] ---- -$ sudo yum install git +$ sudo yum install git-all ---- ////////////////////////// @@ -51,7 +51,7 @@ Ubuntu같은 데비안류 배포판에서는 apt-get을 사용한다. [source,console] ---- -$ sudo apt-get install git +$ sudo apt-get install git-all ---- ////////////////////////// diff --git a/book/02-git-basics/sections/tagging.asc b/book/02-git-basics/sections/tagging.asc index c24f8e40..45246b27 100644 --- a/book/02-git-basics/sections/tagging.asc +++ b/book/02-git-basics/sections/tagging.asc @@ -49,7 +49,7 @@ Git 소스 저장소는 500여 개의 태그가 있다. [source,console] ---- -$ git tag -l 'v1.8.5*' +$ git tag -l "v1.8.5*" v1.8.5 v1.8.5-rc0 v1.8.5-rc1 @@ -102,7 +102,7 @@ Annotated 태그를 만드는 방법은 간단하다. [source,console] ---- -$ git tag -a v1.4 -m 'my version 1.4' +$ git tag -a v1.4 -m "my version 1.4" $ git tag v0.1 v1.3 diff --git a/book/03-git-branching/sections/remote-branches.asc b/book/03-git-branching/sections/remote-branches.asc index 5726183e..7457a33f 100644 --- a/book/03-git-branching/sections/remote-branches.asc +++ b/book/03-git-branching/sections/remote-branches.asc @@ -276,6 +276,18 @@ Branch serverfix set up to track remote branch serverfix from origin. Switched to a new branch 'serverfix' ---- +////////////////////////// +In fact, this is so common that there's even a shortcut for that shortcut. If the branch name you're trying to checkout (a) doesn't exist and (b) exactly matches a name on only one remote, Git will create a tracking branch for you: +////////////////////////// +이 명령은 매우 자주 쓰여서 더 생략할 수 있다. 입력한 브랜치가 있는 (a) 리모트가 딱 하나 있고 (b) 로컬에는 없으면 Git은 트래킹 브랜치를 만들어 준다. + +[source,console] +---- +$ git checkout serverfix +Branch serverfix set up to track remote branch serverfix from origin. +Switched to a new branch 'serverfix' +---- + ////////////////////////// To set up a local branch with a different name than the remote branch, you can easily use the first version with a different local branch name: ////////////////////////// diff --git a/book/04-git-server/sections/git-daemon.asc b/book/04-git-server/sections/git-daemon.asc index 00cf50de..822fe0bb 100644 --- a/book/04-git-server/sections/git-daemon.asc +++ b/book/04-git-server/sections/git-daemon.asc @@ -50,7 +50,7 @@ So, in the following file [source,console] ---- -/etc/event.d/local-git-daemon +/etc/init/local-git-daemon.conf ---- ////////////////////////// @@ -65,6 +65,7 @@ stop on shutdown exec /usr/bin/git daemon \ --user=git --group=git \ --reuseaddr \ + --detach \ --base-path=/opt/git/ \ /opt/git/ respawn diff --git a/book/04-git-server/sections/smart-http.asc b/book/04-git-server/sections/smart-http.asc index 393e4911..3c5efaae 100644 --- a/book/04-git-server/sections/smart-http.asc +++ b/book/04-git-server/sections/smart-http.asc @@ -25,13 +25,23 @@ If you don't have Apache setup, you can do so on a Linux box with something like [source,console] ---- $ sudo apt-get install apache2 apache2-utils -$ a2enmod cgi alias env +$ a2enmod cgi alias env rewrite ---- ////////////////////////// -This also enables the `mod_cgi`, `mod_alias`, and `mod_env` modules, which are all needed for this to work properly. +This also enables the `mod_cgi`, `mod_alias`, `mod_env`, and `mod_rewrite` modules, which are all needed for this to work properly. ////////////////////////// -이 명령어 한 방이면 mod_cgi, mod_alias, mod_env도 사용할 수 있다. 다 앞으로 사용할 모듈들이다. +이 명령어 한 방이면 `mod_cgi`, `mod_alias`, `mod_env`, `mod_rewrite`도 사용할 수 있다. 다 앞으로 사용할 모듈들이다. + +////////////////////////// +You’ll also need to set the Unix user group of the `/opt/git` directories to `www-data` so your web server can read- and write-access the repositories, because the Apache instance running the CGI script will (by default) be running as that user: +////////////////////////// +`/opt/git` 디렉토리의 Unix 사용자 그룹도 `www-data`로 설정해야 한다. 그래야 웹 서버가 저장소를 읽고 쓸 수 있다. Apache 인스턴스는 CGI 스크립트를 이 사용자로 실행시킨다(기본 설정이다). + +[source,console] +---- +$ chgrp -R www-data /opt/git +---- ////////////////////////// Next we need to add some things to the Apache configuration to run the `git http-backend` as the handler for anything coming into the `/git` path of your web server. @@ -51,33 +61,26 @@ If you leave out `GIT_HTTP_EXPORT_ALL` environment variable, then Git will only `GIT_HTTP_EXPORT_ALL` 환경 변수를 설정하지 않으면 `git-daemon-export-ok` 파일이 있는 저장소에는 아무나 다 접근할 수 있게 된다. 그냥 데몬 동작과 똑같다. ////////////////////////// -Then you'll have to tell Apache to allow requests to that path with something like this: +Finally you'll want to tell Apache to allow requests to `git-http-backend` and make writes be authenticated somehow, possibly with an Auth block like this: ////////////////////////// -다음엔 경로 설정을 해준다. +마지막으로 Apache가 `git-http-backend`에 요청하는 것을 허용하고 쓰기 접근 시 인증하게 한다. [source,console] ---- - - Options ExecCGI Indexes - Order allow,deny - Allow from all - Require all granted - ----- - -////////////////////////// -Finally you'll want to make writes be authenticated somehow, possibly with an Auth block like this: -////////////////////////// -마지막으로 인증 설정을 해준다. +RewriteEngine On +RewriteCond %{QUERY_STRING} service=git-receive-pack [OR] +RewriteCond %{REQUEST_URI} /git-receive-pack$ +RewriteRule ^/git/ - [E=AUTHREQUIRED] -[source,console] ----- - + AuthType Basic AuthName "Git Access" AuthUserFile /opt/git/.htpasswd Require valid-user - + Order deny,allow + Deny from env=AUTHREQUIRED + Satisfy any + ---- ////////////////////////// @@ -89,7 +92,7 @@ Here is an example of adding a ``schacon'' user to the file: [source,console] ---- -$ htdigest -c /opt/git/.htpasswd "Git Access" schacon +$ htpasswd -c /opt/git/.htpasswd schacon ---- ////////////////////////// diff --git a/book/06-github/sections/3-maintaining.asc b/book/06-github/sections/3-maintaining.asc index 5afaa7c2..40d1b67b 100644 --- a/book/06-github/sections/3-maintaining.asc +++ b/book/06-github/sections/3-maintaining.asc @@ -56,7 +56,7 @@ For now, just click the ``Create Repository'' button, and boom – you have a ne ``Create Repository'' 버튼을 클릭하면 '뿅'하고 `/` 위치에 GitHub 저장소가 생긴다. ////////////////////////// -Since you have no code there yet, GitHub will show you instructions for how create a brand-new Git repository, or connect an existing Git project. +Since you have no code there yet, GitHub will show you instructions for how to create a brand-new Git repository, or connect an existing Git project. We won't belabor this here; if you need a refresher, check out <<_git_basics_chapter>>. ////////////////////////// 아직 저장소에 코드가 하나도 없어서, GitHub은 Git 저장소를 만드는 방법이나 기존 Git 프로젝트를 넣는 방법을 보여준다. diff --git a/book/06-github/sections/5-scripting.asc b/book/06-github/sections/5-scripting.asc index 133f1136..22426b83 100644 --- a/book/06-github/sections/5-scripting.asc +++ b/book/06-github/sections/5-scripting.asc @@ -390,7 +390,7 @@ You can use the API to do just about anything you can do on the website -- creat ==== Pull Request의 상태 변경하기 ////////////////////////// -One final example we'll look at since it's really useful if you're working with Pull Requests. +There is one final example we'll look at since it's really useful if you're working with Pull Requests. Each commit can have one or more statuses associated with it and there is an API to add and query that status. ////////////////////////// 우리가 살펴볼 마지막 예제는 Pull Request에 관한 것인데 굉장히 유용하다. diff --git a/book/07-git-tools/sections/credentials.asc b/book/07-git-tools/sections/credentials.asc index 7a62b0f8..653c3421 100644 --- a/book/07-git-tools/sections/credentials.asc +++ b/book/07-git-tools/sections/credentials.asc @@ -31,9 +31,8 @@ Git Credential 기능이 제공하는 옵션은 아래와 같다. The downside of this approach is that your passwords are stored in cleartext in a plain file in your home directory. * If you're using a Mac, Git comes with an ``osxkeychain'' mode, which caches credentials in the secure keychain that's attached to your system account. This method stores the credentials on disk, and they never expire, but they're encrypted with the same system that stores HTTPS certificates and Safari auto-fills. -* If you're using Windows, you can install a helper called ``winstore.'' +* If you're using Windows, you can install a helper called ``wincred.'' This is similar to the ``osxkeychain'' helper described above, but uses the Windows Credential Store to control sensitive information. - It can be found at https://gitcredentialstore.codeplex.com[]. //////////////////// * 일단 기본적으로 아무런 설정도 하지 않으면 어떤 비밀번호도 저장하지 않는다. 이 경우 인증이 필요한 때 매번 사용자 이름과 비밀번호를 입력해야 한다. @@ -44,9 +43,8 @@ Git Credential 기능이 제공하는 옵션은 아래와 같다. ``store'' 모드를 사용할 때 주의할 점은 인증정보가 사용자 홈 디렉토리 아래에 일반 텍스트 파일로 저장된다는 점이다. * Mac에서 Git을 사용하는 경우 ``osxkeychain'' 모드를 사용하면 Mac에서 제공하는 Keychain 시스템에 사용자 이름과 비밀번호를 현재 로그인 계정에 속하게 저장한다. ``store'' 모드하면 인증정보를 Disk에 저장하고 인증정보가 만료되지 않는 점은 같지만, Safari 브라우저가 인증정보를 저장하는 것과 같은 수준으로 암호화해서 저장한다는 점이 다르다. -* 윈도우 환경에서는 ``winstore'' 라는 Helper가 있다. +* 윈도우 환경에서는 ``wincred'' 라는 Helper가 있다. ``osxkeychain'' Helper와 비슷하게 동작하며 Windows Credential Store를 사용하여 안전하게 인증정보를 저장한다. - https://gitcredentialstore.codeplex.com[] 사이트를 참고한다. //////////////////// You can choose one of these methods by setting a Git configuration value: @@ -245,10 +243,10 @@ https://bob:s3cre7@mygithost //////////////////// It's just a series of lines, each of which contains a credential-decorated URL. -The `osxkeychain` and `winstore` helpers use the native format of their backing stores, while `cache` uses its own in-memory format (which no other process can read). +The `osxkeychain` and `wincred` helpers use the native format of their backing stores, while `cache` uses its own in-memory format (which no other process can read). //////////////////// 단순한 텍스트파일로 인증정보가 포함된 URL 형태로 저장한다. -`osxkeychain`이나 `winstore` Helper를 사용하면 OS에서 제공하는 좀 더 안전한 저장소에 인증정보를 저장한다. `cache` Helper의 경우 나름의 형식으로 메모리에 인증정보를 저장하고 다른 프로세스에서는 (메모리의 내용을) 읽어갈 수 없다. +`osxkeychain`이나 `wincred` Helper를 사용하면 OS에서 제공하는 좀 더 안전한 저장소에 인증정보를 저장한다. `cache` Helper의 경우 나름의 형식으로 메모리에 인증정보를 저장하고 다른 프로세스에서는 (메모리의 내용을) 읽어갈 수 없다. //////////////////// ==== A Custom Credential Cache diff --git a/book/A-git-in-other-environments/sections/zsh.asc b/book/A-git-in-other-environments/sections/zsh.asc index 75763d00..0d606bd3 100644 --- a/book/A-git-in-other-environments/sections/zsh.asc +++ b/book/A-git-in-other-environments/sections/zsh.asc @@ -5,12 +5,12 @@ (((zsh)))(((tab completion, zsh)))(((shell prompts, zsh))) ////////////////////////// -Git also ships with a tab-completion library for Zsh. -Just copy `contrib/completion/git-completion.zsh` to your home directory and source it from your `.zshrc`. +Zsh also ships with a tab-completion library for Git. +To use it, simply run `autoload -Uz compinit && compinit` in your `.zshrc`. Zsh's interface is a bit more powerful than Bash's: ////////////////////////// -Git에는 Zsh용 탭 자동완성 스크립트도 들어 있다. -`contrib/completion/git-completion.zsh`를 홈 디렉토리에 복사하고 `.zshrc`에 설정(Source)한다. +Zsh에는 Git용 탭 자동완성 스크립트가 들어 있다. +`.zshrc` 파일에서 단순히 `autoload -Uz compinit && compinit` 명령을 실행하면 된다. Zsh은 Bash보다 더 강력하다. [source,console] @@ -26,10 +26,10 @@ cherry-pick -- apply changes introduced by some existing commits ////////////////////////// Ambiguous tab-completions aren't just listed; they have helpful descriptions, and you can graphically navigate the list by repeatedly hitting tab. -This works with Git commands, their arguments, and names of things inside the repository (like refs and remotes), as well filenames and all the other things Zsh knows how to tab-complete. +This works with Git commands, their arguments, and names of things inside the repository (like refs and remotes), as well as filenames and all the other things Zsh knows how to tab-complete. ////////////////////////// Zsh은 선택지가 여러 개일 때 단순히 이름만 보여주지 않는다. 간단한 설명도 함께 보여주고 탭 키로 고를 수 있다. -Git 명령어만이 아니라 아규먼트도 자동완성해준다. 게다가 저장소의 리모트나 Refs같은 이름과 파일 이름 같은 것도 자동완성한다. Zsh은 아는 모든 것을 제시한다. +Git 명령어만이 아니라 아규먼트도 자동완성해준다. 게다가 저장소의 리모트나 Refs 이름과 파일 이름 같은 것도 자동완성한다. Zsh은 아는 모든 것을 제시한다. ////////////////////////// Zsh happens to be fairly compatible with Bash when it comes to prompt customization, but it allows you to have a right-side prompt as well. @@ -38,19 +38,32 @@ To include the branch name on the right side, add these lines to your `~/.zshrc` Zsh 프롬프트는 Bash과 많이 비슷하지만 오른쪽 프롬프트가 더 있다. 오른쪽 프롬프트에 브랜치 이름을 나오게 하려면 `~/.zshrc` 파일에 아래 라인을 추가한다. +////////////////////////// +Zsh ships with a framework for getting information from version control systems, called `vcs_info`. +To include the branch name in the prompt on the right side, add these lines to your `~/.zshrc` file: +////////////////////////// +Zsh에는 `vcs_info`라는 프레임워크가 포함돼 있다. 여기에는 현재 사용하는 VCS정보가 들어있다. +`~/.zshrc` 파일에 아래 라인을 추가하면 오른쪽 프롬프트에 브랜치 이름이 표시된다. + [source,console] ---- +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) setopt prompt_subst -. ~/git-prompt.sh -export RPROMPT=$'$(__git_ps1 "%s")' +RPROMPT=\$vcs_info_msg_0_ +# PROMPT=\$vcs_info_msg_0_'%# ' +zstyle ':vcs_info:git:*' formats '%b' ---- ////////////////////////// This results in a display of the current branch on the right-hand side of the terminal window, whenever your shell is inside a Git repository. +(The left side is supported as well, of course; just uncomment the assignment to PROMPT.) It looks a bit like this: ////////////////////////// 쉘에서 Git 저장소 디렉토리로 이동하면 터미널 오른쪽에 현 브랜치 이름을 아래와 같이 보여준다. +(물론 주석 처리한 것만 돌리면 왼쪽 프롬프트에서도 잘 된다.) ////////////////////////// .Customized `zsh` prompt. @@ -59,6 +72,20 @@ image::images/zsh-prompt.png[Customized `zsh` prompt.] .`zsh` 프롬프트 설정. image::images/zsh-prompt.png[`zsh` 프롬프트 설정.] +////////////////////////// +For more information on vcs_info, check out its documentation + in the `zshcontrib(1)` manual page, + or online at http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[]. +////////////////////////// +vcs_info에 대한 자세한 정보는 `zshcontrib(1)` 메뉴얼 페이지를 보거나 +http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information[]에서 확인한다. + +////////////////////////// +Instead of vcs_info, you might prefer the prompt customization script that ships with Git, called `git-prompt.sh`; see http://git-prompt.sh[] for details. +`git-prompt.sh` is compatible with both Bash and Zsh. +////////////////////////// +vcs_info말고 Git에 들어 있는 `git-prompt.sh`를 직접 수정해서 사용해도 된다. 자세한 내용은 http://git-prompt.sh[]에서 확인한다. `git-prompt.sh`는 Bash와 Zsh 모두 호환된다. + ////////////////////////// Zsh is powerful enough that there are entire frameworks dedicated to making it better. One of them is called "oh-my-zsh", and it can be found at https://github.com/robbyrussell/oh-my-zsh[].