From f21fe1ef2e962cc1916cd3be95d84f7b20e080a8 Mon Sep 17 00:00:00 2001 From: Dieter Ziller Date: Fri, 20 Sep 2019 19:24:26 +0200 Subject: [PATCH 1/2] =?UTF-8?q?client-bzr.asc=20=C3=BCbersetzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/client-bzr.asc | 132 ++++++++++-------- 1 file changed, 70 insertions(+), 62 deletions(-) diff --git a/book/09-git-and-other-scms/sections/client-bzr.asc b/book/09-git-and-other-scms/sections/client-bzr.asc index 3487f9ba..68217e84 100644 --- a/book/09-git-and-other-scms/sections/client-bzr.asc +++ b/book/09-git-and-other-scms/sections/client-bzr.asc @@ -1,68 +1,74 @@ -==== Git and Bazaar - -Among the DVCS, another famous one is http://bazaar.canonical.com[Bazaar]. -Bazaar is free and open source, and is part of the https://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. - -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 und Bazaar + +Unter den DVCSs ist http://bazaar.canonical.com[Bazaar] ein weiterer bedeutender Vertreter. +Bazaar ist freie Software, Open-Source und ist Teil des https://www.gnu.org[GNU-Projekts]. +Es verhält sich ganz anders als Git. +Manchmal muss man, um das Gleiche wie bei Git machen zu können, ein anderes Schlüsselwort verwenden. Einige gängige Schlüsselwörter haben nicht die gleiche Bedeutung. +Insbesondere das Branch-Management ist sehr verschieden und kann zu Verwirrung und Missverständnissen führen, vor allem, wenn jemand aus dem Umfeld von Git kommt. +Dennoch ist es von Git aus möglich, an einem Bazaar-Repository zu arbeiten. + +Es gibt viele Projekte, die es Ihnen ermöglichen, Git als Bazaar-Client zu nutzen. +Hier werden wir das Projekt von Felipe Contreras verwenden, das Sie unter https://github.com/felipec/git-remote-bzr[] finden können. +Um es zu installieren, müssen Sie nur die Datei git-remote-bzr in einen Ordner herunterladen, der sich in Ihrem Pfad (`$PATH`) befindet: + [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! +Außerdem müssen Sie Bazaar installiert haben. +Das ist alles! -===== Create a Git repository from a Bazaar repository +===== Erstellen eines Git-Repository aus einem Bazaar-Repository -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. +Die Bedienung ist einfach. +Es genügt, ein Bazaar-Repository zu klonen, dem `bzr::` vorangestellt ist. +Da Git und Bazaar beide Vollklone auf Ihrem Computer erstellen, ist es möglich, einen Git-Klon an Ihren lokalen Bazaar-Klon anzuhängen, es wird aber nicht empfohlen. +Es ist viel einfacher, Ihren Git-Klon direkt an den gleichen Ort zu hängen, an dem Ihr Bazaar-Klon hängt – das zentrale Repository. + +Angenommen, Sie haben mit einem Remote-Repository gearbeitet, das sich unter der Adresse `bzr+ssh://developer@mybazaarserver:myproject` befindet. +Dann müssen Sie es wie folgt klonen: -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: [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: +An diesem Punkt wird Ihr Git-Repository erstellt, aber es ist nicht für eine optimale Festplattennutzung komprimiert. +Deshalb sollten Sie auch Ihr Git-Repository bereinigen und komprimieren, vor allem wenn es ein großes ist: + [source,console] ---- $ git gc --aggressive ---- -===== Bazaar branches +===== Bazaar Branches + +Bazaar erlaubt es Ihnen nur, Branches zu klonen, aber ein Repository kann mehrere Branches enthalten, und `git-remote-bzr` kann beides klonen. +Um zum Beispiel einen Branch zu klonen: -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: [source,console] ---- $ git clone bzr::bzr://bzr.savannah.gnu.org/emacs/trunk emacs-trunk ---- -And to clone the whole repository: +Und um das gesamte Repository zu klonen: + [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: +Der zweite Befehl klont alle Branches, die im emacs-Repository enthalten sind; es ist jedoch möglich einige Branches hervorzuheben: + [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: +Einige Remote-Repositorys erlauben es Ihnen nicht, ihre Branches aufzulisten, in diesem Fall müssen Sie sie manuell angeben, und obwohl Sie die Konfiguration im Klon-Befehl angeben könnten, könnten Sie das leichter feststellen: [source,console] ---- @@ -72,59 +78,61 @@ $ git config remote-bzr.branches 'trunk, xwindow' $ git fetch ---- -===== Ignore what is ignored with .bzrignore +===== Ignorieren, was mit .bzrignore ignoriert wird -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. +Da Sie an einem mit Bazaar verwalteten Projekt arbeiten, sollten Sie keine `.gitignore` Datei erstellen, da Sie diese versehentlich unter Versionskontrolle setzen _könnten_ und die anderen mit Bazaar arbeitenden Benutzer dadurch gestört würden. +Die Lösung besteht darin, die `.git/info/exclude` Datei entweder als symbolischen Link oder als normale Datei zu erstellen. +Wir werden später sehen, wie wir dieses Problem lösen können. -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 verwendet das gleiche Modell wie Git, um Dateien zu ignorieren, hat aber auch zwei Funktionen, die kein Äquivalent in Git haben. +Die vollständige Beschreibung finden Sie in der http://doc.bazaar.canonical.com/bzr.2.7/en/user-reference/ignore-help.html[Dokumentation]. +Die beiden Merkmale sind: -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. "!!" ermöglicht es Ihnen, bestimmte Dateimuster zu ignorieren, auch wenn sie mit einer "!"-Regel angegeben werden. +2. "RE:" am Anfang einer Zeile erlaubt es Ihnen, einen https://docs.python.org/3/library/re.html[regulären Python-Ausdruck] anzugeben (Git erlaubt nur Shell Globs). -As a consequence, there are two different situations to consider: +Folglich sind zwei verschiedene Situationen zu prüfen: -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. Wenn die Datei `.bzrignore` keines dieser beiden spezifischen Präfixe enthält, dann können Sie einfach einen symbolischen Link darauf im Repository setzen: `ln -s.bzrignore.git/info/exclude`. +2. Ansonsten müssen Sie die Datei `.git/info/exclude` erstellen und anpassen, um genau die gleichen Dateien in `.bzrignore` zu ignorieren. -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. +Was auch immer der Fall ist, Sie müssen auf jede Änderung von `.bzrignore` achten, um sicherzustellen, dass die Datei `.git/info/exclude` immer `.bzrignore` widerspiegelt. +Wenn sich die Datei `.bzrignore` ändert und eine oder mehrere Zeilen enthält, die mit "!!" oder "RE:" beginnen, muss die Datei `.git/info/exclude` so angepasst werden, dass sie die gleichen Dateien ignoriert, wie die, die mit `.bzrignore` ignoriert werden. +Wenn die Datei `.git/info/exclude` ein symbolischer Link war, müssen Sie außerdem zuerst den symbolischen Link löschen, `.bzrignore` nach `.git/info/exclude` kopieren und diese dann anpassen. +Seien Sie jedoch vorsichtig bei der Erstellung, da es mit Git unmöglich ist, eine Datei wieder einzubinden, wenn ein übergeordnetes Verzeichnis dieser Datei ausgeschlossen ist. -===== Fetch the changes of the remote repository +===== Fetchen der Änderungen aus dem Remote-Repository + +Um die Änderungen des Remote zu fetchen, pullen Sie die Änderungen wie gewohnt mit Hilfe von Git-Befehlen. +Angenommen, Ihre Änderungen befinden sich im `master` Branch, mergen oder rebasieren Sie Ihre Arbeit auf den `origin/master` Branch: -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: [source,console] ---- $ git pull --rebase origin ---- -===== Push your work on the remote repository +===== Ihre Arbeit zum Remote-Repository pushen + +In Basaar ist das Konzept der Merge-Commits ebenfalls vorhanden, so dass es kein Problem geben wird, wenn Sie einen Merge Commit pushen. +So können Sie an einem Branch arbeiten, Änderungen in `master` zusammenführen und Ihre Arbeit pushen. +Dann erstellen Sie Ihre Branches, testen und committen Ihre Arbeit wie gewohnt. +Schließlich pushen Sie Ihre Arbeit in das Bazaar-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: [source,console] ---- $ git push origin master ---- -===== Caveats +===== Vorbehalte/Einschränkungen -Git's remote-helpers framework has some limitations that apply. -In particular, these commands don't work: +Das Remote-Helfer-Framework von Git hat einige gültige Beschränkungen. +Vor allem funktionieren diese Befehle nicht: -* 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 kann auf diese Weise keine Referenzen löschen) +* git push origin alt:neu (es wird 'alt' pushen) +* git push --dry-run origin branch (es wird pushen) -===== Summary +===== Zusammenfassung -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. +Die Modelle von Git und Bazaar sind sehr ähnlich, so dass es beim Arbeiten über die Grenzen keinen großen Aufwand erfordert. +Solange Sie auf die Einschränkungen achten und sich immer bewusst sind, dass das Remote-Repository nicht nativ Git ist, werden Sie damit umgehen können. From db1713bf5cf548270b6199681bd8e6e3942bff42 Mon Sep 17 00:00:00 2001 From: Dieter Ziller Date: Fri, 20 Sep 2019 19:36:59 +0200 Subject: [PATCH 2/2] Update status.json --- status.json | 1 + 1 file changed, 1 insertion(+) diff --git a/status.json b/status.json index 85a395d0..e8864c45 100644 --- a/status.json +++ b/status.json @@ -85,6 +85,7 @@ }, "09-git-and-other-scms": { "1-git-and-other-scms.asc": 100, + "sections/client-bzr.asc": 100, "sections/client-hg.asc": 100, "sections/client-p4.asc": 0, "sections/client-svn.asc": 100,