From 8d95c720aa0ea2972c5e595243ea03c2a35cf152 Mon Sep 17 00:00:00 2001 From: pastatopf Date: Tue, 15 Oct 2019 19:17:37 +0200 Subject: [PATCH 1/3] Started translation to german of file book/10-git-internals/sections/objects.asc --- book/10-git-internals/sections/objects.asc | 66 ++++++++++++---------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 1e48a81f..0a8815ab 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -1,15 +1,15 @@ [[_objects]] -=== Git Objects +=== Git Objekte -Git is a content-addressable filesystem. -Great. -What does that mean? -It means that at the core of Git is a simple key-value data store. -What this means is that you can insert any kind of content into a Git repository, for which Git will hand you back a unique key you can use later to retrieve that content. +Git ist ein inhalts-adressierbares Dateisystem. +Toll. +Was bedeutet das? +Dies bedeutet, dass der Kern von Git ein einfacher Schlüssel-Wert-Datenspeicher ist. +Dies bedeutet, dass Sie jede Art von Inhalt in ein Git-Repository einfügen können. Git gibt Ihnen einen eindeutigen Schlüssel zurück, mit dem Sie den Inhalt später abrufen können. -As a demonstration, let's look at the plumbing command `git hash-object`, which takes some data, stores it in your `.git/objects` directory (the _object database_), and gives you back the unique key that now refers to that data object. +Schauen wir uns als Beispiel den Installationsbefehl `git hash-object` an, der einige Daten aufnimmt, sie in Ihrem `.git/objects`-Verzeichnis (der _object database_) speichert und Ihnen den eindeutigen Schlüssel zurückgibt, der nun auf dieses Datenobjekt verweist. -First, you initialize a new Git repository and verify that there is (predictably) nothing in the `objects` directory: +Zunächst initialisieren Sie ein neues Git-Repository und stellen sicher, dass sich (vorhersehbar) nichts im `objects`-Verzeichniss befindet: [source,console] ---- @@ -23,8 +23,8 @@ $ find .git/objects $ find .git/objects -type f ---- -Git has initialized the `objects` directory and created `pack` and `info` subdirectories in it, but there are no regular files. -Now, let's use `git hash-object` to create a new data object and manually store it in your new Git database: +Git hat das Verzeichnis `objects` initialisiert und darin die Unterverzeichnisse `pack` und `info` erstellt, aber es gibt darin keine regulären Dateien. +Jetzt erstellen wir mit `git hash-object` ein neues Datenobjekt und speichern es manuell in Ihrer neuen Git-Datenbank: [source,console] ---- @@ -32,13 +32,13 @@ $ echo 'test content' | git hash-object -w --stdin d670460b4b4aece5915caf5c68d12f560a9fe3e4 ---- -In its simplest form, `git hash-object` would take the content you handed to it and merely return the unique key that _would_ be used to store it in your Git database. -The `-w` option then tells the command to not simply return the key, but to write that object to the database. -Finally, the `--stdin` option tells `git hash-object` to get the content to be processed from stdin; otherwise, the command would expect a filename argument at the end of the command containing the content to be used. +In seiner einfachsten Form würde `git hash-object` den Inhalt, den Sie ihm übergeben haben, nehmen und _würde_ lediglich den eindeutigen Schlüssel zurückgeben, der zum Speichern in Ihrer Git-Datenbank verwendet werden soll. +Die Option -w weist dann den Befehl an, den Schlüssel nicht einfach zurückzugeben, sondern das Objekt in die Datenbank zu schreiben. +Schließlich weist die Option `--stdin` `git hash-object` an, den zu verarbeitenden Inhalt von stdin abzurufen. Andernfalls würde der Befehl ein Dateinamenargument am Ende des Befehls erwarten, das den zu verwendenden Inhalt enthält. -The output from the above command is a 40-character checksum hash. -This is the SHA-1 hash -- a checksum of the content you're storing plus a header, which you'll learn about in a bit. -Now you can see how Git has stored your data: +Die Ausgabe des obigen Befehls ist ein Prüfsummen-Hash mit 40 Zeichen. +Dies ist der SHA-1-Hash - eine Prüfsumme des Inhalts, den Sie speichern, sowie eine Kopfzeile, über die Sie in Kürze mehr erfahren werden. +Jetzt können Sie sehen, wie Git Ihre Daten gespeichert hat: [source,console] ---- @@ -46,13 +46,13 @@ $ find .git/objects -type f .git/objects/d6/70460b4b4aece5915caf5c68d12f560a9fe3e4 ---- -If you again examine your `objects` directory, you can see that it now contains a file for that new content. -This is how Git stores the content initially -- as a single file per piece of content, named with the SHA-1 checksum of the content and its header. -The subdirectory is named with the first 2 characters of the SHA-1, and the filename is the remaining 38 characters. +Wenn Sie Ihr `objects`-verzeichnis erneut untersuchen, können Sie feststellen, dass es jetzt eine Datei für diesen neuen Inhalt enthält. +Auf diese Weise speichert Git den Inhalt initial -- als einzelne Datei pro Inhaltselement, benannt mit der SHA-1-Prüfsumme des Inhalts und seiner Kopfzeile. +Das Unterverzeichnis wird mit den ersten 2 Zeichen des SHA-1 benannt, und der Dateiname enthält die verbleibenden 38 Zeichen. -Once you have content in your object database, you can examine that content with the `git cat-file` command. -This command is sort of a Swiss army knife for inspecting Git objects. -Passing `-p` to `cat-file` instructs the command to first figure out the type of content, then display it appropriately: +Sobald Sie Inhalt in Ihrer Objektdatenbank haben, können Sie diesen Inhalt mit dem Befehl `git cat-file` untersuchen. +Dieser Befehl ist eine Art Schweizer Taschenmesser für die Inspektion von Git-Objekten. +Wenn Sie `-p` an `cat-file` übergeben, wird der Befehl angewiesen, zuerst den Inhaltstyp zu ermitteln und ihn dann entsprechend anzuzeigen: [source,console] ---- @@ -60,10 +60,10 @@ $ git cat-file -p d670460b4b4aece5915caf5c68d12f560a9fe3e4 test content ---- -Now, you can add content to Git and pull it back out again. -You can also do this with content in files. -For example, you can do some simple version control on a file. -First, create a new file and save its contents in your database: +Jetzt können Sie Inhalte zu Git hinzufügen und wieder herausziehen. +Sie können dies auch mit Inhalten in Dateien tun. +Sie können beispielsweise eine einfache Versionskontrolle für eine Datei durchführen. +Erstellen Sie zunächst eine neue Datei und speichern Sie deren Inhalt in Ihrer Datenbank: [source,console] ---- @@ -72,7 +72,7 @@ $ git hash-object -w test.txt 83baae61804e65cc73a7201a7252750c76066a30 ---- -Then, write some new content to the file, and save it again: +Schreiben Sie dann neuen Inhalt in die Datei und speichern Sie ihn erneut: [source,console] ---- @@ -81,7 +81,7 @@ $ git hash-object -w test.txt 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a ---- -Your object database now contains both versions of this new file (as well as the first content you stored there): +Ihre Objektdatenbank enthält nun beide Versionen dieser neuen Datei (sowie den ersten Inhalt, den Sie dort gespeichert haben): [source,console] ---- @@ -91,7 +91,7 @@ $ find .git/objects -type f .git/objects/d6/70460b4b4aece5915caf5c68d12f560a9fe3e4 ---- -At this point, you can delete your local copy of that `test.txt` file, then use Git to retrieve, from the object database, either the first version you saved: +Zu diesem Zeitpunkt können Sie Ihre lokale Kopie dieser `test.txt`-Datei löschen und dann mit Git entweder die erste gespeicherte Version aus der Objektdatenbank abrufen: [source,console] ---- @@ -100,7 +100,7 @@ $ cat test.txt version 1 ---- -or the second version: +oder die zweite Version: [source,console] ---- @@ -113,6 +113,10 @@ But remembering the SHA-1 key for each version of your file isn't practical; plu This object type is called a _blob_. You can have Git tell you the object type of any object in Git, given its SHA-1 key, with `git cat-file -t`: +Es ist jedoch nicht sinnvoll, sich den SHA-1-Schlüssel für jede Version Ihrer Datei zu merken. Außerdem speichern Sie den Dateinamen nicht in Ihrem System, sondern nur den Inhalt. +Dieser Objekttyp wird als _blob_ bezeichnet. +Git kann Ihnen den Objekttyp jedes Objekts in Git mitteilen, wenn sie den SHA-1-Schlüssel mit `git cat-file -t` angegeben: + [source,console] ---- $ git cat-file -t 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a @@ -120,7 +124,7 @@ blob ---- [[_tree_objects]] -==== Tree Objects +==== Baum Objekte The next type of Git object we'll examine is the _tree_, which solves the problem of storing the filename and also allows you to store a group of files together. Git stores content in a manner similar to a UNIX filesystem, but a bit simplified. From 397aed86db6f5413186a953e9c5251a92b2f0e80 Mon Sep 17 00:00:00 2001 From: pastatopf Date: Tue, 15 Oct 2019 22:04:50 +0200 Subject: [PATCH 2/3] Continued translation of file book/10-git-internals/sections/objects.asc --- book/10-git-internals/sections/objects.asc | 66 ++++++++++------------ 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 0a8815ab..9010d0a9 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -109,10 +109,6 @@ $ cat test.txt version 2 ---- -But remembering the SHA-1 key for each version of your file isn't practical; plus, you aren't storing the filename in your system -- just the content. -This object type is called a _blob_. -You can have Git tell you the object type of any object in Git, given its SHA-1 key, with `git cat-file -t`: - Es ist jedoch nicht sinnvoll, sich den SHA-1-Schlüssel für jede Version Ihrer Datei zu merken. Außerdem speichern Sie den Dateinamen nicht in Ihrem System, sondern nur den Inhalt. Dieser Objekttyp wird als _blob_ bezeichnet. Git kann Ihnen den Objekttyp jedes Objekts in Git mitteilen, wenn sie den SHA-1-Schlüssel mit `git cat-file -t` angegeben: @@ -126,11 +122,11 @@ blob [[_tree_objects]] ==== Baum Objekte -The next type of Git object we'll examine is the _tree_, which solves the problem of storing the filename and also allows you to store a group of files together. -Git stores content in a manner similar to a UNIX filesystem, but a bit simplified. -All the content is stored as tree and blob objects, with trees corresponding to UNIX directory entries and blobs corresponding more or less to inodes or file contents. -A single tree object contains one or more entries, each of which is the SHA-1 hash of a blob or subtree with its associated mode, type, and filename. -For example, the most recent tree in a project may look something like this: +Die nächste Art von Git-Objekte, die wir untersuchen, ist der _baum_, der das Problem des Speicherns des Dateinamens löst und es Ihnen auch ermöglicht, eine Gruppe von Dateien zusammen zu speichern. +Git speichert Inhalte auf ähnliche Weise wie ein UNIX-Dateisystem, jedoch etwas vereinfacht. +Der gesamte Inhalt wird als Baum- und Blob-Objekte gespeichert, wobei Bäume UNIX-Verzeichniseinträgen entsprechen und Blobs mehr oder weniger Inodes oder Dateiinhalten entsprechen. +Ein einzelnes Baumobjekt enthält einen oder mehrere Einträge, von denen jeder der SHA-1-Hash eines Blobs oder Teilbaums mit dem zugehörigen Modus, Typ und Dateinamen ist. +Der aktuellste Baum in einem Projekt sieht beispielsweise folgendermaßen aus: [source,console] ---- @@ -140,8 +136,8 @@ $ git cat-file -p master^{tree} 040000 tree 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 lib ---- -The `master^{tree}` syntax specifies the tree object that is pointed to by the last commit on your `master` branch. -Notice that the `lib` subdirectory isn't a blob but a pointer to another tree: +Die `master^{tree}` Syntax gibt das Baumobjekt an, auf das durch das letzte Commit in Ihrem `master`-Zweig verwiesen wird. +Beachten Sie, dass das Unterverzeichnis `lib` kein Blob ist, sondern ein Zeiger auf einen anderen Baum: [source,console] ---- @@ -149,28 +145,28 @@ $ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 100644 blob 47c6340d6459e05787f644c2447d2595f5d3a54b simplegit.rb ---- -[NOTE] +[HINWEIS] ==== -Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax. +Je nachdem, welche Shell Sie verwenden, können bei der Verwendung der `master^{tree}`-Syntax Fehler auftreten. -In CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p master^^{tree}`. -When using PowerShell, parameters using {} characters have to be quoted to avoid the parameter being parsed incorrectly: `git cat-file -p 'master^{tree}'`. +In CMD unter Windows wird das Zeichen `^` für das Escapezeichen verwendet, daher müssen Sie es verdoppeln, um dies zu vermeiden: `git cat-file -p master^^{tree}`. +Bei Verwendung von PowerShell müssen Parameter mit {} Zeichen in Anführungszeichen gesetzt werden, um eine fehlerhafte Syntaxanalyse des Parameters zu vermeiden: `git cat-file -p 'master^{tree}'`. -If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"`. +Wenn Sie ZSH verwenden, wird das Zeichen `^` zum Verschieben verwendet, daher müssen Sie den gesamten Ausdruck in Anführungszeichen setzen: `git cat-file -p "master^{tree}"`. ==== -Conceptually, the data that Git is storing looks something like this: +Konzeptionell sehen die von Git gespeicherten Daten ungefähr so aus: -.Simple version of the Git data model. -image::images/data-model-1.png[Simple version of the Git data model.] +.Einfache Version des Git-Datenmodells. +image::images/data-model-1.png[Einfache Version des Git-Datenmodells.] -You can fairly easily create your own tree. -Git normally creates a tree by taking the state of your staging area or index and writing a series of tree objects from it. -So, to create a tree object, you first have to set up an index by staging some files. -To create an index with a single entry -- the first version of your `test.txt` file -- you can use the plumbing command `git update-index`. -You use this command to artificially add the earlier version of the `test.txt` file to a new staging area. -You must pass it the `--add` option because the file doesn't yet exist in your staging area (you don't even have a staging area set up yet) and `--cacheinfo` because the file you're adding isn't in your directory but is in your database. -Then, you specify the mode, SHA-1, and filename: +Sie können ziemlich einfach Ihren eigenen Baum erstellen. +Git erstellt normalerweise einen Baum, indem es den Status Ihres Staging-Bereichs oder Index übernimmt und eine Reihe von Baumobjekten daraus schreibt. +Um ein Baumobjekt zu erstellen, müssen Sie zunächst einen Index einrichten, indem Sie einige Dateien bereitstellen. +Um einen Index mit einem einzigen Eintrag zu erstellen -- der ersten Version Ihrer `test.txt`-Datei -- können Sie den Basisbefehl `git update-index` verwenden. +Mit diesem Befehl fügen Sie die frühere Version der Datei `test.txt` künstlich einem neuen Staging-Bereich hinzu. +Sie müssen die Option `--add` übergeben, da die Datei in Ihrem Staging-Bereich noch nicht vorhanden ist (Sie haben noch nicht einmal einen Staging-Bereich eingerichtet). `--cacheinfo` müssen sie angeben, weil die hinzugefügte Datei sich nicht in Ihrem Verzeichnis, sondern in Ihrer Datenbank befindet. +Dann geben Sie den Modus, SHA-1 und Dateinamen an: [source,console] ---- @@ -178,12 +174,12 @@ $ git update-index --add --cacheinfo 100644 \ 83baae61804e65cc73a7201a7252750c76066a30 test.txt ---- -In this case, you're specifying a mode of `100644`, which means it's a normal file. -Other options are `100755`, which means it's an executable file; and `120000`, which specifies a symbolic link. -The mode is taken from normal UNIX modes but is much less flexible -- these three modes are the only ones that are valid for files (blobs) in Git (although other modes are used for directories and submodules). +In diesem Fall geben Sie den Modus `100644` an, was bedeutet, dass es sich um eine normale Datei handelt. +Andere Optionen sind `100755`, was bedeutet, dass es sich um eine ausführbare Datei handelt und `120000`, was einen symbolischen Link angibt. +Der Modus stammt aus normalen UNIX-Modi, ist jedoch viel weniger flexibel -- diese drei Modi sind die einzigen, die für Dateien (Blobs) in Git gültig sind (obwohl andere Modi für Verzeichnisse und Submodule verwendet werden). -Now, you can use `git write-tree` to write the staging area out to a tree object. -No `-w` option is needed -- calling this command automatically creates a tree object from the state of the index if that tree doesn't yet exist: +Jetzt können Sie `git write-tree` verwenden, um den Staging-Bereich in ein Baumobjekt zu schreiben. +Es ist keine Option `-w` erforderlich. Durch Aufrufen dieses Befehls wird automatisch ein Baumobjekt aus dem Status des Index erstellt, wenn dieser Baum noch nicht vorhanden ist: [source,console] ---- @@ -193,7 +189,7 @@ $ git cat-file -p d8329fc1cc938780ffdd9f94e0d364e0ea74f579 100644 blob 83baae61804e65cc73a7201a7252750c76066a30 test.txt ---- -You can also verify that this is a tree object using the same `git cat-file` command you saw earlier: +Sie können auch überprüfen, ob es sich um ein Baumobjekt handelt, indem Sie denselben Befehl `git cat-file` verwenden, den Sie zuvor gesehen haben: [source,console] ---- @@ -201,7 +197,7 @@ $ git cat-file -t d8329fc1cc938780ffdd9f94e0d364e0ea74f579 tree ---- -You'll now create a new tree with the second version of `test.txt` and a new file as well: +Sie erstellen jetzt einen neuen Baum mit der zweiten Version von `test.txt` und einer neuen Datei: [source,console] ---- @@ -211,8 +207,8 @@ $ git update-index --add --cacheinfo 100644 \ $ git update-index --add new.txt ---- -Your staging area now has the new version of `test.txt` as well as the new file `new.txt`. -Write out that tree (recording the state of the staging area or index to a tree object) and see what it looks like: +Ihr Staging-Bereich enthält jetzt die neue Version von `test.txt` sowie die neue Datei `new.txt`. +Schreiben Sie diesen Baum aus (zeichnen Sie den Status des Staging-Bereichs oder des Index für ein Baumobjekt auf) und sehen Sie, wie er aussieht: [source,console] ---- From e3545d62aeeabad759bdf6b9a3d3cf2cd6cca4c3 Mon Sep 17 00:00:00 2001 From: pastatopf Date: Wed, 16 Oct 2019 14:11:42 +0200 Subject: [PATCH 3/3] Translated book/10-git-internals/sections/objects.asc to german --- book/10-git-internals/sections/objects.asc | 102 ++++++++++----------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 9010d0a9..20751e62 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -9,7 +9,7 @@ Dies bedeutet, dass Sie jede Art von Inhalt in ein Git-Repository einfügen kön Schauen wir uns als Beispiel den Installationsbefehl `git hash-object` an, der einige Daten aufnimmt, sie in Ihrem `.git/objects`-Verzeichnis (der _object database_) speichert und Ihnen den eindeutigen Schlüssel zurückgibt, der nun auf dieses Datenobjekt verweist. -Zunächst initialisieren Sie ein neues Git-Repository und stellen sicher, dass sich (vorhersehbar) nichts im `objects`-Verzeichniss befindet: +Zunächst initialisieren Sie ein neues Git-Repository und stellen sicher, dass sich (vorhersehbar) nichts im `objects`-Verzeichnis befindet: [source,console] ---- @@ -219,10 +219,10 @@ $ git cat-file -p 0155eb4229851634a0f03eb265b69f5a2d56f341 100644 blob 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a test.txt ---- -Notice that this tree has both file entries and also that the `test.txt` SHA-1 is the ``version 2'' SHA-1 from earlier (`1f7a7a`). -Just for fun, you'll add the first tree as a subdirectory into this one. -You can read trees into your staging area by calling `git read-tree`. -In this case, you can read an existing tree into your staging area as a subtree by using the `--prefix` option with this command: +Beachten Sie, dass dieser Baum beide Dateieinträge enthält und dass der SHA-1 von `test.txt` der SHA-1 ``Version 2'' von früher (`1f7a7a`) entspricht. +Aus Spaß fügen Sie diesem den ersten Baum als Unterverzeichnis hinzu. +Sie können Bäume in Ihren Staging-Bereich einlesen, indem Sie `git read-tree` aufrufen. +In diesem Fall können Sie einen vorhandenen Baum als Teilbaum in Ihren Staging-Bereich einlesen, indem Sie die Option `--prefix` mit diesem Befehl verwenden: [source,console] ---- @@ -235,21 +235,21 @@ $ git cat-file -p 3c4e9cd789d88d8d89c1073707c3585e41b0e614 100644 blob 1f7a7a472abf3dd9643fd615f6da379c4acb3e3a test.txt ---- -If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the `test.txt` file. -You can think of the data that Git contains for these structures as being like this: +Wenn Sie aus dem soeben erstellten Baum ein Arbeitsverzeichnis erstellen, erhalten Sie die beiden Dateien in der obersten Ebene des Arbeitsverzeichnisses und ein Unterverzeichnis mit dem Namen `bak`, das die erste Version der Datei `test.txt` enthält. +Sie können sich die Daten, die Git für diese Strukturen enthält, so vorstellen: -.The content structure of your current Git data. -image::images/data-model-2.png[The content structure of your current Git data.] +.Die Inhaltsstruktur Ihrer aktuellen Git-Daten. +image::images/data-model-2.png[Die Inhaltsstruktur Ihrer aktuellen Git-Daten.] [[_git_commit_objects]] -==== Commit Objects +==== Commit Objekte -If you've done all of the above, you now have three trees that represent the different snapshots of your project that you want to track, but the earlier problem remains: you must remember all three SHA-1 values in order to recall the snapshots. -You also don't have any information about who saved the snapshots, when they were saved, or why they were saved. -This is the basic information that the commit object stores for you. +Wenn Sie alle oben genannten Schritte ausgeführt haben, verfügen Sie nun über drei Bäume, die die verschiedenen Schnappschüsse Ihres Projekts darstellen, die Sie verfolgen möchten. Das bisherige Problem bleibt jedoch bestehen: Sie müssen sich alle drei SHA-1-Werte merken, um die Schnappschüsse abzurufen. +Sie haben auch keine Informationen darüber, wer die Schnappschüsse gespeichert hat, wann sie gespeichert wurden oder warum sie gespeichert wurden. +Dies sind die grundlegenden Informationen, die das Commit Objekt für Sie speichert. -To create a commit object, you call `commit-tree` and specify a single tree SHA-1 and which commit objects, if any, directly preceded it. -Start with the first tree you wrote: +Um ein Commit Objekt zu erstellen, rufen Sie `commit-tree` auf und geben einen einzelnen Baum SHA-1 an. Außerdem geben sie an welche Commit Objekte die direkten Vorgänger sind (falls überhaupt welche vorhanden sind). +Beginnen Sie mit dem ersten Baum, den Sie geschrieben haben: [source,console] ---- @@ -257,9 +257,9 @@ $ echo 'first commit' | git commit-tree d8329f fdf4fc3344e67ab068f836878b6c4951e3b15f3d ---- -You will get a different hash value because of different creation time and author data. -Replace commit and tag hashes with your own checksums further in this chapter. -Now you can look at your new commit object with `git cat-file`: +Sie erhalten einen anderen Hash-Wert, da die Erstellungszeit und die Autorendaten unterschiedlich sind. +Ersetzen Sie Commit- und Tag-Hashes durch Ihre eigenen Prüfsummen dieses Kapitels. +Nun können Sie sich Ihr neues Commit-Objekt mit `git cat-file` ansehen: [source,console] ---- @@ -271,9 +271,9 @@ committer Scott Chacon 1243040974 -0700 first commit ---- -The format for a commit object is simple: it specifies the top-level tree for the snapshot of the project at that point; the parent commits if any (the commit object described above does not have any parents); the author/committer information (which uses your `user.name` and `user.email` configuration settings and a timestamp); a blank line, and then the commit message. +Das Format für ein Commit Objekt ist einfach: Es gibt den Baum der obersten Ebene für den Snapshot des Projekts zu diesem Zeitpunkt an; Das übergeordnete Objekt, falls vorhanden, (das oben beschriebene Commit Objekt hat keine übergeordneten Objekte); die Autoren-/Committer-Informationen (genutzt werden Ihre Konfigurationseinstellungen `user.name` und `user.email` sowie einen Zeitstempel); eine leere Zeile und dann die Commit-Nachricht. -Next, you'll write the other two commit objects, each referencing the commit that came directly before it: +Als Nächstes schreiben Sie die beiden anderen Commit Objekte, die jeweils auf das Commit verweisen, welches direkt davor erfolgte: [source,console] ---- @@ -283,8 +283,8 @@ $ echo 'third commit' | git commit-tree 3c4e9c -p cac0cab 1a410efbd13591db07496601ebc7a059dd55cfe9 ---- -Each of the three commit objects points to one of the three snapshot trees you created. -Oddly enough, you have a real Git history now that you can view with the `git log` command, if you run it on the last commit SHA-1: +Jedes der drei Commit-Objekte verweist auf einen der drei von Ihnen erstellten Snapshot-Bäume. +Seltsamerweise haben Sie jetzt einen echten Git-Verlauf, den Sie mit dem Befehl `git log` anzeigen können, wenn Sie ihn beim letzten Commit SHA-1 ausführen: [source,console] ---- @@ -318,11 +318,11 @@ Date: Fri May 22 18:09:34 2009 -0700 1 file changed, 1 insertion(+) ---- -Amazing. -You've just done the low-level operations to build up a Git history without using any of the front end commands. -This is essentially what Git does when you run the `git add` and `git commit` commands -- it stores blobs for the files that have changed, updates the index, writes out trees, and writes commit objects that reference the top-level trees and the commits that came immediately before them. -These three main Git objects -- the blob, the tree, and the commit -- are initially stored as separate files in your `.git/objects` directory. -Here are all the objects in the example directory now, commented with what they store: +Wundervoll. +Sie haben gerade Basisbefehle der niedrigen Ebene ausgeführt, um einen Git-Verlauf zu erstellen, ohne einen der Standardbefehle zu verwenden. +Dies ist im Wesentlichen das, was Git tut, wenn Sie die Befehle `git add` und `git commit` ausführen -- es speichert Blobs für die geänderten Dateien, aktualisiert den Index, schreibt Bäume und schreibt Commit-Objekte, die auf Bäume der oberste Ebene verweisen und die Commits, die unmittelbar vor ihnen aufgetreten sind. +Diese drei Haupt-Git-Objekte -- der Blob, der Baum und das Commit - werden anfänglich als separate Dateien in Ihrem `.git/objects`-Verzeichnis gespeichert. +Hier sind jetzt alle Objekte im Beispielverzeichnis, kommentiert mit dem, was sie speichern: [source,console] ---- @@ -339,18 +339,18 @@ $ find .git/objects -type f .git/objects/fd/f4fc3344e67ab068f836878b6c4951e3b15f3d # commit 1 ---- -If you follow all the internal pointers, you get an object graph something like this: +Wenn Sie allen internen Zeigern folgen, erhalten Sie eine Objektgrafik in etwa wie folgt: -.All the reachable objects in your Git directory. -image::images/data-model-3.png[All the reachable objects in your Git directory.] +.Alle erreichbaren Objekte in Ihrem Git-Verzeichnis. +image::images/data-model-3.png[Alle erreichbaren Objekte in Ihrem Git-Verzeichnis.] -==== Object Storage +==== Objektspeicher -We mentioned earlier that there is a header stored with every object you commit to your Git object database. -Let's take a minute to see how Git stores its objects. -You'll see how to store a blob object -- in this case, the string ``what is up, doc?'' -- interactively in the Ruby scripting language. +Wir haben bereits erwähnt, dass für jedes Objekt, das Sie in Ihre Git-Objektdatenbank übernehmen, ein Header gespeichert ist. +Nehmen wir uns eine Minute Zeit, um zu sehen, wie Git seine Objekte speichert. +Sie werden sehen, wie Sie ein Blob-Objekt -- in diesem Fall die Zeichenfolge ``what is up, doc?'' - interaktiv in der Ruby-Skriptsprache speichern. -You can start up interactive Ruby mode with the `irb` command: +Sie können den interaktiven Ruby-Modus mit dem Befehl `irb` starten: [source,console] ---- @@ -359,8 +359,8 @@ $ irb => "what is up, doc?" ---- -Git first constructs a header which starts by identifying the type of object -- in this case, a blob. -To that first part of the header, Git adds a space followed by the size in bytes of the content, and adding a final null byte: +Git erstellt zuerst einen Header, der mit der Identifizierung des Objekttyps beginnt -- in diesem Fall ein Blob. +Zu diesem ersten Teil des Headers fügt Git ein Leerzeichen hinzu, gefolgt von der Größe des Inhalts in Bytes, und fügt ein letztes Nullbyte hinzu: [source,console] ---- @@ -368,8 +368,8 @@ To that first part of the header, Git adds a space followed by the size in bytes => "blob 16\u0000" ---- -Git concatenates the header and the original content and then calculates the SHA-1 checksum of that new content. -You can calculate the SHA-1 value of a string in Ruby by including the SHA1 digest library with the `require` command and then calling `Digest::SHA1.hexdigest()` with the string: +Git verkettet den Header und den ursprünglichen Inhalt und berechnet dann die SHA-1-Prüfsumme dieses neuen Inhalts. +Sie können den SHA-1-Wert einer Zeichenfolge in Ruby berechnen, indem Sie die SHA1-Digest-Bibliothek mit dem Befehl `require` hinzufügen und dann `Digest::SHA1.hexdigest()` mit der Zeichenfolge aufrufen: [source,console] ---- @@ -381,8 +381,8 @@ You can calculate the SHA-1 value of a string in Ruby by including the SHA1 dige => "bd9dbf5aae1a3862dd1526723246b20206e5fc37" ---- -Let's compare that to the output of `git hash-object`. -Here we use `echo -n` to prevent adding a newline to the input. +Vergleichen wir dies mit der Ausgabe von `git hash-object`. +Hier verwenden wir `echo -n`, um zu verhindern, dass der Eingabe eine neue Zeile hinzugefügt wird. [source,console] ---- @@ -390,8 +390,8 @@ $ echo -n "what is up, doc?" | git hash-object --stdin bd9dbf5aae1a3862dd1526723246b20206e5fc37 ---- -Git compresses the new content with zlib, which you can do in Ruby with the zlib library. -First, you need to require the library and then run `Zlib::Deflate.deflate()` on the content: +Git komprimiert den neuen Inhalt mit zlib, was Sie in Ruby mit der zlib-Bibliothek tun können. +Zuerst müssen Sie die Bibliothek hinzufügen und dann `Zlib::Deflate.deflate()` auf den Inhalt ausführen: [source,console] ---- @@ -401,10 +401,10 @@ First, you need to require the library and then run `Zlib::Deflate.deflate()` on => "x\x9CK\xCA\xC9OR04c(\xCFH,Q\xC8,V(-\xD0QH\xC9O\xB6\a\x00_\x1C\a\x9D" ---- -Finally, you'll write your zlib-deflated content to an object on disk. -You'll determine the path of the object you want to write out (the first two characters of the SHA-1 value being the subdirectory name, and the last 38 characters being the filename within that directory). -In Ruby, you can use the `FileUtils.mkdir_p()` function to create the subdirectory if it doesn't exist. -Then, open the file with `File.open()` and write out the previously zlib-compressed content to the file with a `write()` call on the resulting file handle: +Schließlich schreiben Sie Ihren zlib-entpackten Inhalt auf ein Objekt auf der Festplatte. +Sie bestimmen den Pfad des Objekts, das Sie ausschreiben möchten (die ersten beiden Zeichen des SHA-1-Werts sind der Name des Unterverzeichnisses und die letzten 38 Zeichen der Dateiname in diesem Verzeichnis). +In Ruby können Sie die Funktion `FileUtils.mkdir_p()` verwenden, um das Unterverzeichnis zu erstellen, falls es nicht vorhanden ist. +Öffnen Sie dann die Datei mit `File.open()` und schreiben Sie den zuvor mit zlib komprimierten Inhalt mit einem `write()` -Aufruf auf das resultierende Dateihandle in die Datei: [source,console] ---- @@ -418,7 +418,7 @@ Then, open the file with `File.open()` and write out the previously zlib-compres => 32 ---- -Let's check the content of the object using `git cat-file`: +Lassen Sie uns den Inhalt des Objekts mit `git cat-file` überprüfen: [source,console] --- @@ -426,7 +426,7 @@ $ git cat-file -p bd9dbf5aae1a3862dd1526723246b20206e5fc37 what is up, doc? --- -That's it – you've created a valid Git blob object. +Das war's - Sie haben ein gültiges Git-Blob-Objekt erstellt. -All Git objects are stored the same way, just with different types – instead of the string blob, the header will begin with commit or tree. -Also, although the blob content can be nearly anything, the commit and tree content are very specifically formatted. +Alle Git-Objekte werden auf dieselbe Weise gespeichert, nur mit unterschiedlichen Typen. Anstelle des String-Blobs beginnt der Header mit commit oder tree. +Auch wenn der Blob-Inhalt nahezu beliebig sein kann, sind Commit- und Tree-Inhalt sehr spezifisch formatiert.