Skip to content

Commit b4dbe3d

Browse files
committed
Update client-hg.asc
1 parent 3e7e627 commit b4dbe3d

File tree

1 file changed

+45
-45
lines changed

1 file changed

+45
-45
lines changed

book/09-git-and-other-scms/sections/client-hg.asc

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
==== Git and Mercurial
1+
==== Git und Mercurial
22

33
(((Interoperation with other VCSs, Mercurial)))
44
(((Mercurial)))
5-
The DVCS universe is larger than just Git.
6-
In fact, there are many other systems in this space, each with their own angle on how to do distributed version control correctly.
7-
Apart from Git, the most popular is Mercurial, and the two are very similar in many respects.
5+
Das DVCS-Universum besteht nicht nur aus nur Git.
6+
In diesem Bereich gibt es viele andere Systeme, jedes hat seinen eigenen Ansatz, wie eine verteilte Versionskontrolle zu funktionieren hat.
7+
Neben Git ist Mercurial am populärsten und die beiden sind sich in vielerlei Hinsicht sehr ähnlich.
88

9-
The good news, if you prefer Git's client-side behavior but are working with a project whose source code is controlled with Mercurial, is that there's a way to use Git as a client for a Mercurial-hosted repository.
10-
Since the way Git talks to server repositories is through remotes, it should come as no surprise that this bridge is implemented as a remote helper.
11-
The project's name is git-remote-hg, and it can be found at https://github.com/felipec/git-remote-hg[].
9+
Die gute Nachricht, wenn Sie Gits clientseitiges Verhalten bevorzugen, aber mit einem Projekt arbeiten, dessen Quellcode mit Mercurial verwaltet wird, dann ist es möglich, Git als Client für ein von Mercurial gehostetes Repository zu verwenden.
10+
Da die Art und Weise, wie Git über Remotes mit Server-Repositories kommuniziert, sollte es nicht überraschen, dass diese Bridge als Remote-Helfer implementiert ist.
11+
Der Name des Projekts lautet git-remote-hg und ist unter https://github.com/felipec/git-remote-hg[] zu finden.
1212

1313
===== git-remote-hg
1414

15-
First, you need to install git-remote-hg.
16-
This basically entails dropping its file somewhere in your path, like so:
15+
Zuerst müssen Sie git-remote-hg installieren.
16+
Im Wesentlichen geht es darum, die Datei irgendwo in Ihrem Pfad abzulegen, so wie hier:
1717

1818
[source,console]
1919
----
@@ -22,35 +22,35 @@ $ curl -o ~/bin/git-remote-hg \
2222
$ chmod +x ~/bin/git-remote-hg
2323
----
2424

25-
assuming `~/bin` is in your `$PATH`.
26-
Git-remote-hg has one other dependency: the `mercurial` library for Python.
27-
If you have Python installed, this is as simple as:
25+
vorausgesetzt (in einer Linux-Umgebung), `~/bin` ist in Ihrem `$PATH`.
26+
Git-remote-hg hat noch eine weitere Abhängigkeit: die `mercurial` Library für Python.
27+
Wenn Sie Python installiert schon haben, ist das einfach:
2828

2929
[source,console]
3030
----
3131
$ pip install mercurial
3232
----
3333

34-
(If you don't have Python installed, visit https://www.python.org/[] and get it first.)
34+
(Wenn Sie Python noch nicht installiert haben, besuchen Sie https://www.python.org/[] und besorgen Sie es sich zuerst.)
3535

36-
The last thing you'll need is the Mercurial client.
37-
Go to https://www.mercurial-scm.org/[] and install it if you haven't already.
36+
Als Letztes brauchen Sie den Mercurial-Client.
37+
Gehen Sie zu https://www.mercurial-scm.org/[] und installieren Sie ihn, falls Sie es noch nicht getan haben.
3838

39-
Now you're ready to rock.
40-
All you need is a Mercurial repository you can push to.
41-
Fortunately, every Mercurial repository can act this way, so we'll just use the "hello world" repository everyone uses to learn Mercurial:
39+
Jetzt sind Sie bereit zu abrocken.
40+
Alles, was Sie benötigen, ist ein Mercurial-Repository, auf das Sie zugreifen können.
41+
Glücklicherweise kann sich jedes Mercurial-Repository so verhalten, also verwenden wir einfach das "hello world"-Repository, das jeder benutzt, um Mercurial zu lernen:
4242

4343
[source,console]
4444
----
4545
$ hg clone http://selenic.com/repo/hello /tmp/hello
4646
----
4747

48-
===== Getting Started
48+
===== Erste Schritte
4949

50-
Now that we have a suitable ``server-side'' repository, we can go through a typical workflow.
51-
As you'll see, these two systems are similar enough that there isn't much friction.
50+
Nun, da wir über ein geeignetes „serverseitiges“ Repository verfügen, können wir einen typischen Workflow durchlaufen.
51+
Wie Sie sehen werden, sind diese beiden Systeme ähnlich genug, dass es keine große Überschneidungen gibt.
5252

53-
As always with Git, first we clone:
53+
Wie immer mit Git, wir klonen zuerst:
5454

5555
[source,console]
5656
----
@@ -61,13 +61,13 @@ $ git log --oneline --graph --decorate
6161
* 65bb417 Create a standard "hello, world" program
6262
----
6363

64-
You'll notice that working with a Mercurial repository uses the standard `git clone` command.
65-
That's because git-remote-hg is working at a fairly low level, using a similar mechanism to how Git's HTTP/S protocol is implemented (remote helpers).
66-
Since Git and Mercurial are both designed for every client to have a full copy of the repository history, this command makes a full clone, including all the project's history, and does it fairly quickly.
64+
Wie Sie sehen, verwendet man bei der Arbeit mit einem Mercurial-Repository den Standardbefehl `git clone`.
65+
Das liegt daran, dass git-remote-hg auf einem relativ niedrigen Level arbeitet und einen ähnlichen Mechanismus verwendet, wie es die Implementierung des HTTP/S-Protokolls in Git ist (Remote-Helfer).
66+
Da Git und Mercurial beide so konzipiert sind, dass jeder Client eine vollständige Kopie der Repository-Historie hat, erstellt dieser Befehl relativ schnell einen vollständigen Klon, einschließlich der gesamten Projekthistorie.
6767

68-
The log command shows two commits, the latest of which is pointed to by a whole slew of refs.
69-
It turns out some of these aren't actually there.
70-
Let's take a look at what's actually in the `.git` directory:
68+
Der log-Befehl zeigt zwei Commits, von denen der letzte von einer ganzen Reihe von Refs angeführt wird.
69+
Wie sich herausstellt, sind einige davon nicht wirklich da.
70+
Werfen wir einen Blick darauf, was sich wirklich im `.git` Verzeichnis befindet:
7171

7272
[source,console]
7373
----
@@ -91,13 +91,13 @@ $ tree .git/refs
9191
9 directories, 5 files
9292
----
9393

94-
Git-remote-hg is trying to make things more idiomatically Git-esque, but under the hood it's managing the conceptual mapping between two slightly different systems.
95-
The `refs/hg` directory is where the actual remote refs are stored.
96-
For example, the `refs/hg/origin/branches/default` is a Git ref file that contains the SHA-1 starting with ``ac7955c'', which is the commit that `master` points to.
97-
So the `refs/hg` directory is kind of like a fake `refs/remotes/origin`, but it has the added distinction between bookmarks and branches.
94+
Git-remote-hg versucht sich idiomatisch (begrifflich) an Git anzunähern, aber im Hintergrund verwaltet es die konzeptionelle Zuordnung zwischen zwei leicht unterschiedlichen Systemen.
95+
Im Verzeichnis `refs/hg` werden die aktuellen Remote-Referenzen gespeichert.
96+
Zum Beispiel ist die `refs/hg/origin/branches/default` eine Git ref-Datei, die das SHA-1 enthält und mit „ac7955c“ beginnt. Das ist der Commit, auf den `master` zeigt.
97+
Das Verzeichnis `refs/hg` ist also eine Art gefälschtes `refs/remotes/origin`, aber es unterscheidet zusätzlich zwischen Lesezeichen und Zweigen.
9898

99-
The `notes/hg` file is the starting point for how git-remote-hg maps Git commit hashes to Mercurial changeset IDs.
100-
Let's explore a bit:
99+
Die Datei `notes/hg` ist der Ausgangspunkt dafür, wie git-remote-hg Git-Commit-Hashes auf Mercurial-Changeset-IDs abbildet.
100+
Lassen Sie uns ein wenig experimentieren:
101101

102102
[source,console]
103103
----
@@ -119,28 +119,28 @@ $ git cat-file -p ac9117f
119119
0a04b987be5ae354b710cefeba0e2d9de7ad41a9
120120
----
121121

122-
So `refs/notes/hg` points to a tree, which in the Git object database is a list of other objects with names.
123-
`git ls-tree` outputs the mode, type, object hash, and filename for items inside a tree.
124-
Once we dig down to one of the tree items, we find that inside it is a blob named ``ac9117f'' (the SHA-1 hash of the commit pointed to by `master`), with contents ``0a04b98'' (which is the ID of the Mercurial changeset at the tip of the `default` branch).
122+
So zeigt refs/notes/hg auf einen Verzeichnisbaum, der in der Git-Objektdatenbank eine Liste anderer Objekte mit Namen ist.
123+
`git ls-tree` gibt Modus, Typ, Objekt-Hash und Dateiname für Elemente innerhalb eines Baums aus.
124+
Sobald wir uns auf eines der Baumelemente festgelegt haben, stellen wir fest, dass sich darin ein „ac9117f“ Blob (der SHA-1-Hash des Commit, auf den `master` zeigt) befindet. Inhaltlich ist er identisch mit "0a04b98" (das ist die ID des Mercurial-Changesets an der Spitze der `default` Branch).
125125

126-
The good news is that we mostly don't have to worry about all of this.
127-
The typical workflow won't be very different from working with a Git remote.
126+
Die gute Nachricht ist, dass wir uns darüber meistens keine Sorgen machen müssen.
127+
Der typische Arbeitsablauf unterscheidet sich nicht wesentlich von der Arbeit mit einem Git-Remote.
128128

129-
There's one more thing we should attend to before we continue: ignores.
130-
Mercurial and Git use a very similar mechanism for this, but it's likely you don't want to actually commit a `.gitignore` file into a Mercurial repository.
131-
Fortunately, Git has a way to ignore files that's local to an on-disk repository, and the Mercurial format is compatible with Git, so you just have to copy it over:
129+
Noch eine Besonderheit, um die wir uns kümmern sollten, bevor wir fortfahren: Die Auslassungen.
130+
Mercurial und Git verwenden dafür einen sehr ähnlichen Mechanismus, aber es ist durchaus möglich, dass Sie eine `.gitignore` Datei nicht wirklich in ein Mercurial Repository übertragen wollen.
131+
Glücklicherweise hat Git eine Möglichkeit, Dateien zu ignorieren, die lokal in einem On-Disk-Repository liegen. Das Mercurial-Format ist kompatibel mit Git, so dass Sie es nur kopieren müssen:
132132

133133
[source,console]
134134
----
135135
$ cp .hgignore .git/info/exclude
136136
----
137137

138-
The `.git/info/exclude` file acts just like a `.gitignore`, but isn't included in commits.
138+
Die Datei `.git/info/exclude` verhält sich wie eine `.gitignore`, wird aber nicht in den Commits aufgenommen.
139139

140140
===== Workflow
141141

142-
Let's assume we've done some work and made some commits on the `master` branch, and you're ready to push it to the remote repository.
143-
Here's what our repository looks like right now:
142+
Nehmen wir an, wir haben einige Arbeiten erledigt und einige Commits auf den `master` Branch gemacht und Sie sind so weit, ihn in das Remote-Repository zu pushen.
143+
Nun sieht unser Repository momentan so aus:
144144

145145
[source,console]
146146
----

0 commit comments

Comments
 (0)