You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your application is for developers, chances are good that it could benefit from integration with source control.
6
-
Even non-developer applications, such as document editors, could potentially benefit from version-control features, and Git's model works very well for many different scenarios.
5
+
Wenn Ihre Anwendung für Software-Entwickler gedacht ist, stehen die Chancen gut, dass sie von der Integration mit der Quellcode-Versionsverwaltung profitieren kann.
6
+
Auch Anwendungen, die nicht für Entwickler bestimmt sind, wie z.B. Texteditoren, könnten potenziell von Funktionen der Versionskontrolle profitieren. Das Git-System funktioniert sehr gut für viele unterschiedliche Einsatzszenarien.
7
7
8
-
If you need to integrate Git with your application, you have essentially two options: spawn a shell and call the `git` command-line program, or embed a Git library into your application.
9
-
Here we'll cover command-line integration and several of the most popular embeddable Git libraries.
8
+
Wenn Sie Git in Ihre Anwendung integrieren müssen, haben Sie im Wesentlichen zwei Möglichkeiten: eine Shell zu erzeugen und damit das Git-Kommandozeilenprogramm aufzurufen oder eine Git-Bibliothek in Ihre Anwendung einzubetten.
9
+
Hier werden wir die Befehlszeilenintegration und einige der beliebtesten, integrierbaren Git-Bibliotheken behandeln.
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/interactive-staging.asc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[[_interactive_staging]]
2
-
=== Interactives Stagen
2
+
=== Interaktives Stagen
3
3
4
4
In diesem Abschnitt werden Sie einige interaktive Git-Befehle kennenlernen, mit denen Sie Ihre Commits so gestalten können, dass sie nur bestimmte Kombinationen und Teile von Dateien enthalten.
5
5
Diese Tools sind nützlich, um zu entscheiden, ob eine Vielzahl von umfassend modifizierten Dateien in mehrere gezielte Commits aufgeteilt oder in einem großen unübersichtlichen Commit übertragen werden sollen.
One option is to spawn a shell process and use the Git command-line tool to do the work.
4
-
This has the benefit of being canonical, and all of Git's features are supported.
5
-
This also happens to be fairly easy, as most runtime environments have a relatively simple facility for invoking a process with command-line arguments.
6
-
However, this approach does have some downsides.
3
+
Die eine Möglichkeit besteht darin, einen Shell-Prozess zu erzeugen und das Git-Kommandozeilen-Tool zu verwenden, um die Arbeit zu erledigen.
4
+
Das hat den Vorteil, dass es kanonisch ist und alle Funktionen von Git unterstützt werden.
5
+
Außerdem ist dieses Verfahren ganz einfach, da die meisten Laufzeit-Umgebungen eine vergleichsweise unkomplizierte Möglichkeit haben, einen Prozess mit Kommandozeilen-Argumenten aufzurufen.
6
+
Dieser Weg hat jedoch auch einige Nachteile.
7
7
8
-
One is that all the output is in plain text.
9
-
This means that you'll have to parse Git's occasionally-changing output format to read progress and result information, which can be inefficient and error-prone.
8
+
Zum einen ist die gesamte Textausgabe in Klartext.
9
+
Das bedeutet, dass Sie das gelegentlich wechselnde Ausgabeformat von Git analysieren müssen, um Fortschritts- und Ergebnisinformationen zu erfassen, was ineffizient und fehleranfällig sein kann.
10
10
11
-
Another is the lack of error recovery.
12
-
If a repository is corrupted somehow, or the user has a malformed configuration value, Git will simply refuse to perform many operations.
11
+
Ein weiterer Nachteil ist die unzureichende Fehlerkorrektur.
12
+
Wenn ein Repository irgendwie beschädigt ist oder der Benutzer einen fehlerhaften Konfigurationswert eingestellt hat, verweigert Git einfach die Durchführung vieler Operationen.
13
13
14
-
Yet another is process management.
15
-
Git requires you to maintain a shell environment on a separate process, which can add unwanted complexity.
16
-
Trying to coordinate many of these processes (especially when potentially accessing the same repository from several processes) can be quite a challenge.
14
+
Noch ein anderer ist das Prozessmanagement.
15
+
Git erfordert die Verwaltung einer Shell-Umgebung in einem separaten Prozess, was zu unerwünschter Komplexität führen kann.
16
+
Der Versuch, viele dieser Prozesse zu koordinieren (insbesondere wenn mehrere Prozesse auf das gleiche Repository zugreifen wollen), kann eine ziemliche Herausforderung darstellen.
Copy file name to clipboardExpand all lines: book/B-embedding-git/sections/dulwich.asc
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
=== Dulwich
2
2
3
3
(((Dulwich)))(((Python)))
4
-
There is also a pure-PythonGit implementation - Dulwich.
5
-
The project is hosted under https://www.dulwich.io/
6
-
It aims to provide an interface to git repositories (both local and remote) that doesn't call out to git directly but instead uses pure Python.
7
-
It has an optional C extensions though, that significantly improve the performance.
4
+
Es gibt auch eine purePython-Implementierung in Git – Dulwich.
5
+
Das Projekt wird unter https://www.dulwich.io/ gehostet.
6
+
Es zielt darauf ab, eine Schnittstelle zu Git-Repositorys (lokal und remote) bereitzustellen, die nicht direkt Git aufruft, sondern stattdessen reines Python verwendet.
7
+
Es hat dennoch eine optionale C-Erweiterung, die die Leistung erheblich verbessert.
8
8
9
-
Dulwich follows git design and separate two basic levels of API: plumbing and porcelain.
9
+
Dulwich folgt dem Git-Design und trennt die beiden grundlegenden API-Bereiche: Basis- und Standardbefehle (engl. plumbing and porcelain).
10
10
11
-
Here is an example of using the lower level API to access the commit message of the last commit:
11
+
Das folgende Beispiel zeigt die API der low-level (Basis-)Ebene, um auf die Commit-Beschreibung des letzten Commits zuzugreifen:
12
12
13
13
[source, python]
14
14
-----
@@ -25,7 +25,7 @@ c.message
25
25
# 'Add note about encoding.\n'
26
26
-----
27
27
28
-
To print a commit log using high-level porcelain API, one can use:
28
+
Zum Drucken eines Commit-Protokolls mit der high-level Standard-API kann man folgendes verwenden:
* The official API documentation is available at https://www.dulwich.io/apidocs/dulwich.html[]
44
-
* Official tutorial at https://www.dulwich.io/docs/tutorial[] has many examples of how to do specific tasks with Dulwich
43
+
* Die offizielle API-Dokumentation ist unter https://www.dulwich.io/apidocs/dulwich.html[] verfügbar.
44
+
* Das offizielle Tutorial bei https://www.dulwich.io/docs/tutorial[] enthält viele Beispiele dafür, wie bestimmte Aufgaben mit Dulwich erledigt werden können.
Copy file name to clipboardExpand all lines: book/B-embedding-git/sections/go-git.asc
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,25 @@
1
1
=== go-git
2
2
3
3
(((go-git)))(((Go)))
4
-
In case you want to integrate Git into a service written in Golang, there also is a pure Go library implementation.
5
-
This implementation does not have any native dependencies and thus is not prone to manual memory management errors.
6
-
It is also transparent for the standard Golang performance analysis tooling like CPU, Memory profilers, race detector, etc.
4
+
Für den Fall, dass Sie Git in einen in Golang geschriebenen Service integrieren wollen, gibt es auch eine direkte Umsetzung der Go-Bibliothek.
5
+
Diese Implementierung hat keine eigenen Abhängigkeiten und ist daher nicht anfällig für manuelle Fehler in der Speicherverwaltung.
6
+
Sie ist auch transparent für die standardmäßigen Golang-Tools zur Leistungsanalyse wie CPU, Memory-Profiler, Race-Detektor usw.
7
7
8
-
go-git is focused on extensibility, compatibility and supports most of the plumbing APIs, which is documented at https://github.com/src-d/go-git/blob/master/COMPATIBILITY.md[].
8
+
go-git konzentriert sich auf Erweiterbarkeit und Kompatibilität. Es unterstützt die meisten APIs für die Basisbefehle (engl. plumbing), die auf https://github.com/go-git/go-git/blob/master/COMPATIBILITY.md[] dokumentiert sind.
9
9
10
-
Here is a basic example of using Go APIs:
10
+
Hier ist ein einfaches Beispiel für die Verwendung der Go-APIs:
As soon as you have a `Repository`instance, you can access information and perform mutations on it:
22
+
Sobald Sie eine `Repository`Instanz haben, können Sie auf Informationen zugreifen und Änderungen daran vornehmen:
23
23
24
24
25
25
[source, go]
@@ -40,25 +40,25 @@ for _, c := range history {
40
40
-----
41
41
42
42
43
-
==== Advanced Functionality
43
+
==== Erweiterte Funktionalität
44
44
45
-
go-git has few notable advanced features, one of which is a pluggable storage system, which is similar to Libgit2 backends.
46
-
The default implementation is in-memory storage, which is very fast.
45
+
go-git hat nur wenige nennenswerte fortgeschrittene Funktionen, von denen eine ein erweiterbares Speichersystem ist, das den Libgit2-Backends ähnlich ist.
46
+
Die Standard-Implementierung ist der In-Memory Storage, welcher sehr effizient ist.
Pluggable storage provides many interesting options.
56
-
For instance, https://github.com/src-d/go-git/tree/master/_examples/storage[] allows you to store references, objects, and configuration in an Aerospike database.
55
+
Die anpassbare Speicherlösung bietet viele interessante Optionen.
56
+
So können Sie beispielsweise mit https://github.com/go-git/go-git/tree/master/_examples/storage[] Referenzen, Objekte und Konfiguration in einer Aerospike-Datenbank speichern.
57
57
58
-
Another feature is a flexible filesystem abstraction.
59
-
Using https://godoc.org/github.com/src-d/go-billy#Filesystem[] it is easy to store all the files in different way i.e by packing all of them to a single archive on disk or by keeping them all in-memory.
58
+
Ein anderes Feature ist eine flexible Abstraktion des Dateisystems.
59
+
Mit https://pkg.go.dev/github.com/go-git/go-billy/v5?tab=doc#Filesystem[] ist es einfach, alle Dateien auf unterschiedliche Weise zu speichern, d.h. alle Dateien in ein einziges Archiv auf der Festplatte zu komprimieren oder sie alle im Arbeitsspeicher zu halten.
60
60
61
-
Another advanced use-case includes a fine-tunable HTTP client, such as the one found at https://github.com/src-d/go-git/blob/master/_examples/custom_http/main.go[].
61
+
Ein weiterer fortgeschrittener Verwendungszweck enthält einen fein anpassbaren HTTP-Client, wie er bei https://github.com/go-git/go-git/blob/master/_examples/custom_http/main.go[] zu finden ist.
A full treatment of go-git's capabilities is outside the scope of this book.
86
-
If you want more information on go-git, there's API documentation at https://godoc.org/gopkg.in/src-d/go-git.v4[], and a set of usage examples at https://github.com/src-d/go-git/tree/master/_examples[].
85
+
Eine vollständige Behandlung der Fähigkeiten von go-git liegt außerhalb des eigentlichen Ziels dieses Buches.
86
+
Wenn Sie weitere Informationen über go-git wünschen, finden Sie die API-Dokumentation auf https://pkg.go.dev/github.com/go-git/go-git/v5[] und eine Reihe von Anwendungsbeispielen unter https://github.com/go-git/go-git/tree/master/_examples[].
0 commit comments