diff --git a/book/01-introduction/sections/about-version-control.asc b/book/01-introduction/sections/about-version-control.asc index 25c5dcd..9e8604f 100644 --- a/book/01-introduction/sections/about-version-control.asc +++ b/book/01-introduction/sections/about-version-control.asc @@ -115,12 +115,12 @@ Local VCS systems suffer from this same problem -- whenever you have the entire (((version control,distributed))) ////////////////////////// This is where Distributed Version Control Systems (DVCSs) step in. -In a DVCS (such as Git, Mercurial, Bazaar or Darcs), clients don't just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history. +In a DVCS (such as Git, Mercurial or Darcs), clients don't just check out the latest snapshot of the files; rather, they fully mirror the repository, including its full history. Thus, if any server dies, and these systems were collaborating via that server, any of the client repositories can be copied back up to the server to restore it. Every clone is really a full backup of all the data. ////////////////////////// DVCS(분산 버전 관리 시스템)을 설명할 차례다. -Git, Mecurial, Bazaar, Darcs 같은 DVCS에서의 클라이언트는 단순히 파일의 마지막 스냅샷을 Checkout 하지 않는다. 그냥 저장소를 히스토리와 더불어 전부 복제한다. +Git, Mecurial, Darcs 같은 DVCS에서의 클라이언트는 단순히 파일의 마지막 스냅샷을 Checkout 하지 않는다. 그냥 저장소를 히스토리와 더불어 전부 복제한다. 서버에 문제가 생기면 이 복제물로 다시 작업을 시작할 수 있다. 클라이언트 중에서 아무거나 골라도 서버를 복원할 수 있다. Clone은 모든 데이터를 가진 진정한 백업이다. diff --git a/book/01-introduction/sections/basics.asc b/book/01-introduction/sections/basics.asc index d888e25..86d5deb 100644 --- a/book/01-introduction/sections/basics.asc +++ b/book/01-introduction/sections/basics.asc @@ -22,11 +22,11 @@ Git을 배우려면 Subversion이나 Perforce 같은 다른 VCS를 사용하던 ////////////////////////// The major difference between Git and any other VCS (Subversion and friends included) is the way Git thinks about its data. Conceptually, most other systems store information as a list of file-based changes. -These other systems (CVS, Subversion, Perforce, Bazaar, and so on) think of the information they store as a set of files and the changes made to each file over time (this is commonly described as _delta-based_ version control). +These other systems (CVS, Subversion, Perforce, and so on) think of the information they store as a set of files and the changes made to each file over time (this is commonly described as _delta-based_ version control). ////////////////////////// Subversion과 Subversion 비슷한 놈들과 Git의 가장 큰 차이점은 데이터를 다루는 방법에 있다. 큰 틀에서 봤을 때 VCS 시스템 대부분은 관리하는 정보가 파일들의 목록이다. -CVS, Subversion, Perforce, Bazaar 등의 시스템은 각 파일의 변화를 시간순으로 관리하면서 파일들의 집합을 관리한다(보통 _델타 기반_ 버전관리 시스템이라 함). +CVS, Subversion, Perforce 등의 시스템은 각 파일의 변화를 시간순으로 관리하면서 파일들의 집합을 관리한다(보통 _델타 기반_ 버전관리 시스템이라 함). ////////////////////////// .Storing data as changes to a base version of each file. diff --git a/book/09-git-and-other-scms/sections/client-bzr.asc b/book/09-git-and-other-scms/sections/client-bzr.asc deleted file mode 100644 index 3031234..0000000 --- a/book/09-git-and-other-scms/sections/client-bzr.asc +++ /dev/null @@ -1,248 +0,0 @@ -////////////////////////// -==== Git and Bazaar -////////////////////////// -==== Git과 Bazaar - -////////////////////////// -Among the DVCS, another famous one is http://bazaar.canonical.com/[Bazaar]. -Bazaar is free and open source, and is part of the http://www.gnu.org/[GNU Project]. -It behaves very differently from Git. -Sometimes, to do the same thing as with Git, you have to use a different keyword, and some keywords that are common don't have the same meaning. -In particular, the branch management is very different and may cause confusion, especially when someone comes from Git's universe. -Nevertheless, it is possible to work on a Bazaar repository from a Git one. -////////////////////////// -DCVS 중에 다른 유명한 것으로 http://bazaar.canonical.com/[Bazaar] 라는 것이 있다. -Bazaar는 무료이고 오픈소스로 http://www.gnu.org/[GNU 프로젝트] 중 하나이다. -Git과 동작방식이 매우 다르다. -Git과 동일한 동작을 하기 위해 매우 다를 키워드를 사용하기도 하며, 같은 키워드가 전혀 다른 의미로 쓰이기도 한다. -특히 브랜치 관리에 대한 개념이 매우 달라 Git을 쓰던 사람에게는 매우 혼란스럽기도 하다. -그럼에도 불구하고 Git 클라이언트를 사용하여 Bazaar의 저장소를 기반으로 버전관리 작업을 할 수 있다. - -////////////////////////// -There are many projects that allow you to use Git as a Bazaar client. -Here we'll use Felipe Contreras' project that you may find at https://github.com/felipec/git-remote-bzr[]. -To install it, you just have to download the file git-remote-bzr in a folder contained in your `$PATH`: -////////////////////////// -여러분이 Git을 Bazaar 클라이언트로 사용하도록 기능을 제공해주는 수 많은 프로젝트가 있다. -이 책에서는 Felipe Contreras의 프로젝트를 가져다 사용하며 https://github.com/felipec/git-remote-bzr[] 에서 구할 수 있다. -프로젝트에서 git-remote-bzr 파일을 받아 `$PATH` 에 지정된 디렉토리 중 하나에 위치시켜 두면 바로 사용할 수 있다. -[source,console] ----- -$ wget https://raw.github.com/felipec/git-remote-bzr/master/git-remote-bzr -O ~/bin/git-remote-bzr -$ chmod +x ~/bin/git-remote-bzr ----- - -////////////////////////// -You also need to have Bazaar installed. -That's all! -////////////////////////// -물론 Bazaar는 설치되어 있어야 한다. -이로서 준비 작업은 끝이다. - -////////////////////////// -===== Create a Git repository from a Bazaar repository -////////////////////////// -===== Bazaar 저장소로부터 Git 저장소 생성 - -////////////////////////// -It is simple to use. -It is enough to clone a Bazaar repository prefixing it by `bzr::`. -Since Git and Bazaar both do full clones to your machine, it's possible to attach a Git clone to your local Bazaar clone, but it isn't recommended. -It's much easier to attach your Git clone directly to the same place your Bazaar clone is attached to ‒ the central repository. -////////////////////////// -Bazaar 저장소를 로컬로 Clone 하기는 쉽다. -저장소 주소 앞에 `bzr::` 문자열을 붙여서 Clone 하면 된다. -Git과 Bazaar 모두 저장소 전체를 로컬로 복제하여 사용하기 때문에 로컬에 이미 내려받은 Bazaar 저장소를 Clone 해 올 수도 있지만 권장하지는 않는다. -Bazaar 저장소가 가리키고 있는 원래의 리모트 저장소로부터 직접 Clone 하는 것이 여러모로 편리하다. - -////////////////////////// -Let's suppose that you worked with a remote repository which is at address `bzr+ssh://developer@mybazaarserver:myproject`. -Then you must clone it in the following way: -////////////////////////// -리모트 저장소의 주소가 다음과 같이 ssh를 사용하는 경우 `bzr+ssh://developer@mybazaarserver:myproject` -Clone 할 때의 주소는 다음과 같다. -[source,console] ----- -$ git clone bzr::bzr+ssh://developer@mybazaarserver:myproject myProject-Git -$ cd myProject-Git ----- - -////////////////////////// -At this point, your Git repository is created but it is not compacted for optimal disk use. -That's why you should also clean and compact your Git repository, especially if it is a big one: -////////////////////////// -Clone을 하고 나면 Git 저장소가 생성되었지만 디스크 사용에 있어서 최적화 된 상태는 아니다. -저장소 크기가 제법 큰 경우 다음 명령으로 Git 저장소의 디스크 사용을 최적화 시킬 수 있다. -[source,console] ----- -$ git gc --aggressive ----- - -////////////////////////// -===== Bazaar branches -////////////////////////// -===== Bazaar 브랜치 - -////////////////////////// -Bazaar only allows you to clone branches, but a repository may contain several branches, and `git-remote-bzr` can clone both. -For example, to clone a branch: -////////////////////////// -Bazaar의 경우 저장소에는 많은 브랜치가 있더라도 Clone 할 때는 브랜치 하나만을 Clone 할 수 있다. 하지만 `git-remote-bzr` 명령은 두 가지 방식 다 사용 가능하다. 예를 들어 브랜치 하나만 Clone 하려면: -[source,console] ----- -$ git clone bzr::bzr://bzr.savannah.gnu.org/emacs/trunk emacs-trunk ----- - -////////////////////////// -And to clone the whole repository: -////////////////////////// -저장소 전체를 Clone 하려면: -[source,console] ----- -$ git clone bzr::bzr://bzr.savannah.gnu.org/emacs emacs ----- - -////////////////////////// -The second command clones all the branches contained in the emacs repository; nevertheless, it is possible to point out some branches: -////////////////////////// -두 번째 명령을 실행하면 emacs 저장소의 모든 브랜치를 Clone 하게 된다. 일부 브랜치만 Clone 하거나 사용하도록 다음과 같이 설정할 수도 있다. -[source,console] ----- -$ git config remote-bzr.branches 'trunk, xwindow' ----- - -////////////////////////// -Some remote repositories don't allow you to list their branches, in which case you have to manually specify them, and even though you could specify the configuration in the cloning command, you may find this easier: -////////////////////////// -어떤 리모트 저장소의 경우 브랜치의 목록을 보여주지 않을수도 있지만 아래와 같이 직접 지정해준다면 -어렵지 않게 지정된 브랜치를 포함하는 저장소 단위로 Clone 할 수 있다. - -[source,console] ----- -$ git init emacs -$ git remote add origin bzr::bzr://bzr.savannah.gnu.org/emacs -$ git config remote-bzr.branches 'trunk, xwindow' -$ git fetch ----- - -////////////////////////// -===== Ignore what is ignored with .bzrignore -////////////////////////// -===== .bzrignore로 무시하는 파일 Git에서도 무시하기 - -////////////////////////// -Since you are working on a project managed with Bazaar, you shouldn't create a `.gitignore` file because you _may_ accidentally set it under version control and the other people working with Bazaar would be disturbed. -The solution is to create the `.git/info/exclude` file either as a symbolic link or as a regular file. -We'll see later on how to solve this question. -////////////////////////// -Bazaar로 관리하는 저장소에서 작업하는 경우 `.gitignore` 파일을 운영하지 말아야 한다. 이 파일이 생성되어 버전관리에 추가된다면 Bazaar를 사용하는 다른 동료를 방해하는 꼴이다. -이를 해결하기 위해 `.git/info/exclude` 파일에 내용을 입력하거나 링크로 생성하는 방법이 있다. -자세한 내용은 이어지는 부분에서 확인할 수 있다. - -////////////////////////// -Bazaar uses the same model as Git to ignore files, but also has two features which don't have an equivalent into Git. -The complete description may be found in http://doc.bazaar.canonical.com/bzr.2.7/en/user-reference/ignore-help.html[the documentation]. -The two features are: -////////////////////////// -Bazaar의 파일 무시하기 기능은 Git의 무시하기 기능과 같은 방식으로 동작한다. 하지만 정확히 같은 것은 아니며 두 가지 기능이 Git과 다르게 동작한다. -정확한 전체 내용은 http://doc.bazaar.canonical.com/bzr.2.7/en/user-reference/ignore-help.html[ignore 도움말] 에서 확인할 수 있다. -두 가지 다른점은 다음과 같다. - -////////////////////////// -1. "!!" allows you to ignore certain file patterns even if they're specified using a "!" rule. -2. "RE:" at the beginning of a line allows you to specify a https://docs.python.org/3/library/re.html[Python regular expression] (Git only allows shell globs). -////////////////////////// -1. "!!" 문자열로 시작하는 패턴은 이미 "!" 문자열로 시작하는 정의한 패턴을 강제로 다시 적용시키는 규칙이다. (무시하지 않는 것을 다시 무시하기!) -2. "RE:" 문자열로 시작하는 규칙은 https://docs.python.org/3/library/re.html[Python 정규표현식] 을 적용한다. Git은 Glob 패턴만 적용 가능하다. - -////////////////////////// -As a consequence, there are two different situations to consider: -////////////////////////// -이러한 Bazaar 파일 무시하기 규칙을 Git 저장소 관리에도 적용하려면: - -////////////////////////// -1. If the `.bzrignore` file does not contain any of these two specific prefixes, then you can simply make a symbolic link to it in the repository: `ln -s .bzrignore .git/info/exclude` -2. Otherwise, you must create the `.git/info/exclude` file and adapt it to ignore exactly the same files in `.bzrignore`. -////////////////////////// -1. `.bzrignore` 파일이 위의 두 가지 Git과 다른 규칙을 사용하지 않고 있다면 간단히 심볼릭 링크를 만들어 Git 저장소에도 적용할 수 있다: `ln -s .bzrignore .git/info/exclude` -2. 반대의 경우 `.git/info/exclude` 파일을 일반 파일로 생성하거나 수정해서 `.bzrignore` 파일과 같은 의미가 적용되도록 직접 수정해야 한다. - -////////////////////////// -Whatever the case is, you will have to remain vigilant against any change of `.bzrignore` to make sure that the `.git/info/exclude` file always reflects `.bzrignore`. -Indeed, if the `.bzrignore` file were to change and contained one or more lines starting with "!!" or "RE:", Git not being able to interpret these lines, you'll have to adapt your `.git/info/exclude` file to ignore the same files as the ones ignored with `.bzrignore`. -Moreover, if the `.git/info/exclude` file was a symbolic link, you'll have to first delete the symbolic link, copy `.bzrignore` to `.git/info/exclude` and then adapt the latter. -However, be careful with its creation because with Git it is impossible to re-include a file if a parent directory of that file is excluded. -////////////////////////// -어떤 경우에도 `.git/info/exclude` 파일이 `.bzrignore` 파일이 변경됨에 따라 적절하게 내용을 반영하고 있는지 주의를 기울여 살펴봐야 한다. -"!!" 패턴이나 "RE:" 패턴 규칙이 새로이 `.bzrignore` 파일에 적용된 변경이 있을 수 있다. 이렇게 Git이 적절히 처리할 수 없는 패턴이 새로이 생겨난 경우 `.git/info/exclude` 파일을 일반파일로 작성하고 패턴의 내용을 이해한 다음 적절히 변환하여 Git 패턴으로 작성해야 한다. -`.git/info/exclude` 파일은 심볼릭 링크였으므로 일단 이를 지우는 것 부터 반드시 실행해야 한다. 그 이후 `.bzrignore` 파일을 `.git/info/exclude` 파일로 복사하고 Git이 이해하지 못하는 패턴에 대해 변경 작업을 해야 한다. -"!!" 패턴의 경우 Git에는 적용이 불가능하기 때문에 주의해서 이를 변환해야 한다. - -////////////////////////// -===== Fetch the changes of the remote repository -////////////////////////// -===== 리모트 저장소로부터 변경 내용 가져오기 - -////////////////////////// -To fetch the changes of the remote, you pull changes as usually, using Git commands. -Supposing that your changes are on the `master` branch, you merge or rebase your work on the `origin/master` branch: -////////////////////////// -원격 저장소로부터 변경 내용을 가져오려면 보통의 Git 명령을 사용하듯 Pull 명령을 사용한다. -로컬의 변경 내용이 `master` 브랜치에 있다면 `origin/master` 브랜치를 Merge 하거나 다음과 같이 Rebase 하게 된다. -[source,console] ----- -$ git pull --rebase origin ----- - -////////////////////////// -===== Push your work on the remote repository -////////////////////////// -===== 리모트 저장소로 변경 내용 보내기 - -////////////////////////// -Because Bazaar also has the concept of merge commits, there will be no problem if you push a merge commit. -So you can work on a branch, merge the changes into `master` and push your work. -Then, you create your branches, you test and commit your work as usual. -You finally push your work to the Bazaar repository: -////////////////////////// -Bazaar에도 Merge 커밋에 대한 개념이 동일하게 있기 때문에 Merge 커밋을 Push 하는 것은 아무런 문제가 없다. -어떤 브랜치에서 작업을 하다가 `master` 브랜치로 Merge 하고 이를 Push 하는 것 물론 가능하다. -직접 생성한 브랜치를 Push 할 수도 있다. -브랜치를 만들고 테스트와 커밋을 만들고 Bazaar 원격 저장소로 Push 하면 된다. -[source,console] ----- -$ git push origin master ----- - -////////////////////////// -===== Caveats -////////////////////////// -===== 주의 - -////////////////////////// -Git's remote-helpers framework has some limitations that apply. -In particular, these commands don't work: -////////////////////////// -Git의 리모트-헬퍼 프레임워크의 제약사항이 몇가지 적용된다. -특히 아래의 명령을 적용하기 불가능하다. - -////////////////////////// -* git push origin :branch-to-delete (Bazaar can't accept ref deletions in this way.) -* git push origin old:new (it will push 'old') -* git push --dry-run origin branch (it will push) -////////////////////////// -* git push origin :branch-to-delete (Bazaar 에서는 이런식으로 Ref 또는 브랜치 삭제가 불가능) -* git push origin old:new ('old' 브랜치를 Push 하게 됨) -* git push --dry-run origin branch (실제로 Push 하게 됨) - -////////////////////////// -===== Summary -////////////////////////// -===== 요약 - -////////////////////////// -Since Git's and Bazaar's models are similar, there isn't a lot of resistance when working across the boundary. -As long as you watch out for the limitations, and are always aware that the remote repository isn't natively Git, you'll be fine. -////////////////////////// -Git과 Bazaar의 버전관리 모델이 매우 닮아있기 때문에 둘의 경계를 넘나드는 작업은 그리 어려운 것은 아니다. -하지만 아무런 제약사항이 없는 것은 아니기 때문에 Git을 Client로 사용할 때 항상 원격 저장소가 Bazaar 임을 생각해두고 사용한다면 무리는 없을 것이다. diff --git a/book/09-git-and-other-scms/sections/import-bzr.asc b/book/09-git-and-other-scms/sections/import-bzr.asc deleted file mode 100644 index a86c20b..0000000 --- a/book/09-git-and-other-scms/sections/import-bzr.asc +++ /dev/null @@ -1,252 +0,0 @@ -==== Bazaar -(((Bazaar)))(((Importing, from Bazaar))) - -////////////////////////// -Bazaar is a DVCS tool much like Git, and as a result it's pretty straightforward to convert a Bazaar repository into a Git one. -To accomplish this, you'll need to import the `bzr-fastimport` plugin. -////////////////////////// -Bazaar 또한 Git과 비슷한 DVCS 도구이기 때문에 Bazaar 저장소를 Git 저장소로 변환하는 것은 쉬운편이다. -우선 이 작업을 하려면 `bzr-fastimport` 플러그인이 필요하다. - -////////////////////////// -===== Getting the bzr-fastimport plugin -////////////////////////// -===== bzr-fastimport 플러그인 다운로드 - -////////////////////////// -The procedure for installing the fastimport plugin is different on UNIX-like operating systems and on Windows. -In the first case, the simplest is to install the `bzr-fastimport` package that will install all the required dependencies. -////////////////////////// -`bzr-fastimport` 플러그인을 설치하는 방식은 Unix 비슷한 환경과 Windows 환경이 매우 다르다. 우선 Unix 비슷한 환경에서는 운영체제에서 제공하는 패키지 관리자를 통해 `bzr-fastimport` 패키지를 설치하는 방법이 가장 쉽다. - -////////////////////////// -For example, with Debian and derived, you would do the following: -////////////////////////// -예를 들어 Debian 이나 파생 Linux라면 다음과 같이 `bzr-fastimport` 를 설치할 수 있다. - -[source,console] ----- -$ sudo apt-get install bzr-fastimport ----- - -////////////////////////// -With RHEL, you would do the following: -////////////////////////// -RHEL이나 파생 Linux라면 다음과 같이 `bzr-fastimport` 를 설치할 수 있다. - -[source,console] ----- -$ sudo yum install bzr-fastimport ----- - -////////////////////////// -With Fedora, since release 22, the new package manager is dnf: -////////////////////////// -Fedora release 22 이상이라면 dnf를 사용하여 `bzr-fastimport` 를 설치할 수 있다. - -[source,console] ----- -$ sudo dnf install bzr-fastimport ----- - -////////////////////////// -If the package is not available, you may install it as a plugin: -////////////////////////// -패키지 관리자 도구가 없는 경우라면 다음과 같이 Python을 이용하여 플러그인을 설치할 수 있다. - -[source,console] ----- -$ mkdir --parents ~/.bazaar/plugins # creates the necessary folders for the plugins -$ cd ~/.bazaar/plugins -$ bzr branch lp:bzr-fastimport fastimport # imports the fastimport plugin -$ cd fastimport -$ sudo python setup.py install --record=files.txt # installs the plugin ----- - -////////////////////////// -For this plugin to work, you'll also need the `fastimport` Python module. -You can check whether it is present or not and install it with the following commands: -////////////////////////// -`bzr-fastimport` 플러그인을 사용하려면 Python의 `fastimport` 모듈 또한 필요하다. -다음과 같은 명령으로 `fastimport` Python 모듈이 설치되어 있는지, 설치를 어떻게 하는지 살펴볼 수 있다. - -[source,console] ----- -$ python -c "import fastimport" -Traceback (most recent call last): - File "", line 1, in -ImportError: No module named fastimport -$ pip install fastimport ----- -////////////////////////// -If it is not available, you can download it at address https://pypi.python.org/pypi/fastimport/. -////////////////////////// -위 방식이 잘 동작하지 않는 경우 https://pypi.python.org/pypi/fastimport/ 에서 바로 내려 받거나 도움을 얻을 수 있다. - -////////////////////////// -In the second case (on Windows), `bzr-fastimport` is automatically installed with the standalone version and the default installation (let all the checkboxes checked). -So in this case you have nothing to do. -////////////////////////// -Windows 에서 `bzr-fastimport` 는 Git 설치시 Standalone 버전이나 기본 설치(모든 체크박스가 설정되)의 경우 함께 설치된다. -따라서 따로 더 설치 작업이 필요하지 않다. - -////////////////////////// -At this point, the way to import a Bazaar repository differs according to that you have a single branch or you are working with a repository that has several branches. -////////////////////////// -이 시점에서 Bazaar 저장소를 Git 저장소로 변환할 때 브랜치를 하나만 사용하는지 혹은 브랜치를 여러개 사용하는지에 따라 변환 작업이 달라진다. - -////////////////////////// -===== Project with a single branch -////////////////////////// -===== 한 브랜치만 사용하는 프로젝트 - -////////////////////////// -Now `cd` in the directory that contains your Bazaar repository and initialize the Git repository: -////////////////////////// -`cd` 명령으로 Bazaar 저장소가 위치한 디렉토리로 이동하고, Git 저장소를 init 한다. - -[source,console] ----- -$ cd /path/to/the/bzr/repository -$ git init ----- - -////////////////////////// -Now, you can simply export your Bazaar repository and convert it into a Git repository using the following command: -////////////////////////// -다음과 같이 간단한 명령으로 Bazaar 저장소를 Git 저장소로 변환할 수 있다. - -[source,console] ----- -$ bzr fast-export --plain . | git fast-import ----- - -////////////////////////// -Depending on the size of the project, your Git repository is built in a lapse from a few seconds to a few minutes. -////////////////////////// -프로젝트 크기에 따라 수 초 혹은 수 분 내에 Bazaar 저장소의 내용이 Git 저장소에 담길 것이다. - -////////////////////////// -===== Case of a project with a main branch and a working branch -////////////////////////// -===== 메인 브랜치 하나와 작업 브랜치 하나를 사용하는 프로젝트 - -////////////////////////// -You can also import a Bazaar repository that contains branches. -Let us suppose that you have two branches: one represents the main branch (myProject.trunk), the other one is the working branch (myProject.work). -////////////////////////// -여러 브랜치를 사용하는 Bazaar 저장소도 Git 저장소로 변환할 수 있다. -예를 들어 두 개의 브랜치를 사용한다고 가정해보자. 한 브랜치는 메인 브랜치 (myProject.trunk), 다른 브랜치는 작업 브랜치 (myProject.work) 인 경우가 있을 수 있다. - -[source,console] ----- -$ ls -myProject.trunk myProject.work ----- - -////////////////////////// -Create the Git repository and `cd` into it: -////////////////////////// -이 위치에서 새로 Git 저장소를 init 하고 `cd` 명령으로 이동한다. - -[source,console] ----- -$ git init git-repo -$ cd git-repo ----- - -////////////////////////// -Pull the master branch into git: -////////////////////////// -trunk 브랜치의 내용을 master 브랜치로 가져온다. - -[source,console] ----- -$ bzr fast-export --export-marks=../marks.bzr ../myProject.trunk | \ -git fast-import --export-marks=../marks.git ----- - -////////////////////////// -Pull the working branch into Git: -////////////////////////// -work 브랜치의 내용을 work 브랜치로 가져온다. - -[source,console] ----- -$ bzr fast-export --marks=../marks.bzr --git-branch=work ../myProject.work | \ -git fast-import --import-marks=../marks.git --export-marks=../marks.git ----- - -////////////////////////// -Now `git branch` shows you the `master` branch as well as the `work` branch. -Check the logs to make sure they’re complete and get rid of the `marks.bzr` and `marks.git` files. -////////////////////////// -`git branch` 명령으로 `master` 브랜치와 `work` 브랜치를 확인할 수 있다. -히스토리를 확인하여 완전히 저장소와 브랜치의 내용이 변환된 것을 확인한 후 위 과정에서 생성된 `marks.bzr`, `marks.git` 파일을 삭제한다. - -////////////////////////// -===== Synchronizing the staging area -////////////////////////// -===== Staging Area를 동기화 - -////////////////////////// -Whatever the number of branches you had and the import method you used, your staging area is not synchronized with `HEAD`, and with the import of several branches, your working directory is not synchronized either. -This situation is easily solved by the following command: -////////////////////////// -위 과정을 실행하고 나면 하나 혹은 여러 브랜치의 히스토리가 Git 저장소 히스토리로 변환되었지만 Staging Area와 워킹 디렉토리가 `HEAD` 와 동기화가 이루어지지 않은 상태이다. -다음 명령으로 쉽게 `HEAD` 와 동기화를 시킬 수 있다. - -[source,console] ----- -$ git reset --hard HEAD ----- - -////////////////////////// -===== Ignoring the files that were ignored with .bzrignore -////////////////////////// -===== .bzrignore로 무시하는 파일 동일하게 무시 - -////////////////////////// -Now let's have a look at the files to ignore. -The first thing to do is to rename `.bzrignore` into `.gitignore`. -If the `.bzrignore` file contains one or several lines starting with "!!" or "RE:", you'll have to modify it and perhaps create several `.gitignore` files in order to ignore exactly the same files that Bazaar was ignoring. -////////////////////////// -파일 무시하기 내용을 살펴볼 차례이다. -우선 먼저 해야 할 일은 `.bzrignore` 파일을 `.gitignore` 파일로 이름을 변경하는 것이다. -`.bzrignore` 파일이 "!!", "RE:" 문자열로 시작하는 패턴을 포함한다면 이를 적절한 Git 패턴으로 변경하여 `.gitignore` 파일에 작성해야 한다. - -////////////////////////// -Finally, you will have to create a commit that contains this modification for the migration: -////////////////////////// -위 작업을 마치고 난 후 이제 이 변경사항에 대한 커밋을 작성할 차례이다. - -[source,console] ----- -$ git mv .bzrignore .gitignore -$ # modify .gitignore if needed -$ git commit -am 'Migration from Bazaar to Git' ----- - -////////////////////////// -===== Sending your repository to the server -////////////////////////// -===== 서버로 저장소 전송 - -////////////////////////// -Here we are! -Now you can push the repository onto its new home server: -////////////////////////// -고생하셨수다. -이제 서버 혹은 리모트 저장소로 Push 할 수 있다. - -[source,console] ----- -$ git remote add origin git@my-git-server:mygitrepository.git -$ git push origin --all -$ git push origin --tags ----- - -////////////////////////// -Your Git repository is ready to use. -////////////////////////// -이렇게 전송한 리모트 저장소를 Git 저장소로 사용할 수 있다. diff --git a/ch09-git-and-other-systems.asc b/ch09-git-and-other-systems.asc index df3cec1..b5fb79c 100644 --- a/ch09-git-and-other-systems.asc +++ b/ch09-git-and-other-systems.asc @@ -41,8 +41,6 @@ include::book/09-git-and-other-scms/sections/client-svn.asc[] include::book/09-git-and-other-scms/sections/client-hg.asc[] -include::book/09-git-and-other-scms/sections/client-bzr.asc[] - include::book/09-git-and-other-scms/sections/client-p4.asc[] [[_migrating]] @@ -65,8 +63,6 @@ include::book/09-git-and-other-scms/sections/import-svn.asc[] include::book/09-git-and-other-scms/sections/import-hg.asc[] -include::book/09-git-and-other-scms/sections/import-bzr.asc[] - include::book/09-git-and-other-scms/sections/import-p4.asc[] include::book/09-git-and-other-scms/sections/import-tfs.asc[]