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
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/rerere.asc
+40-40Lines changed: 40 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,31 @@
1
1
[[ref_rerere]]
2
2
=== Rerere
3
3
4
-
The `git rerere` functionality is a bit of a hidden feature.
5
-
The name stands for ``reuse recorded resolution'' and, as the name implies, it allows you to ask Git to remember how you've resolved a hunk conflict so that the next time it sees the same conflict, Git can resolve it for you automatically.
4
+
Die Funktion `git rerere` ist eine eher versteckte Komponente.
5
+
Der Name steht für „reuse recorded resolution“ (dt. „gespeicherte Ergebnisse wiederverwenden“). Der Name bedeutet, dass Sie Git auffordern können, sich zu erinnern, wie Sie einen bestimmten Konflikt gelöst haben. Wenn Git das nächste Mal den gleichen Konflikt sieht, kann es ihn automatisch für Sie lösen.
6
6
7
-
There are a number of scenarios in which this functionality might be really handy.
8
-
One of the examples that is mentioned in the documentation is when you want to make sure a long-lived topic branch will ultimately merge cleanly, but you don't want to have a bunch of intermediate merge commits cluttering up your commit history.
9
-
With `rerere` enabled, you can attempt the occasional merge, resolve the conflicts, then back out of the merge.
10
-
If you do this continuously, then the final merge should be easy because `rerere` can just do everything for you automatically.
7
+
Es gibt eine Reihe von Szenarien, in denen diese Funktionalität wirklich nützlich sein kann.
8
+
Eines der Beispiele, das in der Dokumentation erwähnt wird, ist, sicher zu stellen, dass ein langlebiger Topic-Branch am Ende sauber gemergt wird; aber Sie wollen nicht, dass eine Menge zwischenzeitlicher Merge-Commits Ihre Commit-Historie durcheinander bringen.
9
+
Wenn `rerere` aktiviert ist, können Sie ab und zu einen Merge starten, die Konflikte lösen und dann den Merge wieder abbrechen.
10
+
Falls Sie das kontinuierlich tun, dann sollte der endgültige Merge ganz unkompliziert sein, denn `rerere` kann einfach alles für Sie automatisch erledigen.
11
11
12
-
This same tactic can be used if you want to keep a branch rebased so you don't have to deal with the same rebasing conflicts each time you do it.
13
-
Or if you want to take a branch that you merged and fixed a bunch of conflicts and then decide to rebase it instead -- you likely won't have to do all the same conflicts again.
12
+
Dieselbe Taktik kann angewendet werden, wenn Sie einen Branch reorganisiert (engl. rebase) halten wollen, damit Sie sich nicht jedes Mal mit denselben Konflikten beim Rebase auseinandersetzen müssen.
13
+
Auch wenn Sie einen Branch, den Sie schon gemergt und eine Reihe von Konflikten behoben haben; ihn statt zu verwenden, sich für einen Rebase entscheiden – dann müssen Sie wahrscheinlich nicht alle Konflikte erneut lösen.
14
14
15
-
Another application of `rerere` is where you merge a bunch of evolving topic branches together into a testable head occasionally, as the Git project itself often does.
16
-
If the tests fail, you can rewind the merges and re-do them without the topic branch that made the tests fail without having to re-resolve the conflicts again.
15
+
Eine weitere Einsatzmöglichkeit von `rerere` ist, wenn man eine Reihe von sich fortentwickelnden Topic-Branches gelegentlich zu einem überprüfbaren Head zusammenfügt, so wie es das Git-Projekt oft selbst praktiziert.
16
+
Wenn diese Prüfungen fehlschlagen, können Sie die Merges rückgängig machen und sie ohne den fehlerhaften Topic-Branch, erneut starten, ohne die Konflikte erneut auflösen zu müssen.
17
17
18
-
To enable `rerere` functionality, you simply have to run this config setting:
18
+
Um die Funktion `rerere` zu aktivieren, müssen Sie nur die folgende Config-Einstellung verwenden:
19
19
20
20
[source,console]
21
21
----
22
22
$ git config --global rerere.enabled true
23
23
----
24
24
25
-
You can also turn it on by creating the `.git/rr-cache` directory in a specific repository, but the config setting is clearer and enables that feature globally for you.
25
+
Sie können sie auch einschalten, indem Sie das Verzeichnis `.git/rr-cache` in einem konkreten Repository erstellen. Die Konfigurationseinstellung ist allerdings eindeutiger und aktiviert diese Funktion global für Sie.
26
26
27
-
Now let's see a simple example, similar to our previous one.
28
-
Let's say we have a file named `hello.rb` that looks like this:
27
+
Sehen wir uns nun ein einfaches Beispiel an, das unserem vorherigen ähnlich ist.
28
+
Nehmen wir an, wir haben eine Datei namens `hello.rb`, die so aussieht:
29
29
30
30
[source,ruby]
31
31
----
@@ -36,11 +36,11 @@ def hello
36
36
end
37
37
----
38
38
39
-
In one branch we change the word ``hello'' to ``hola'', then in another branch we change the ``world'' to ``mundo'', just like before.
39
+
In der einen Branch ändern wir das Wort „hello“ in „hola“, in der anderen Branch ändern wir die „world“ in „mundo“, wie gehabt.
40
40
41
41
image::images/rerere1.png[]
42
42
43
-
When we merge the two branches together, we'll get a merge conflict:
43
+
Wenn wir die beiden Branches verschmelzen, bekommen wir einen Merge-Konflikt:
44
44
45
45
[source,console]
46
46
----
@@ -51,10 +51,10 @@ Recorded preimage for 'hello.rb'
51
51
Automatic merge failed; fix conflicts and then commit the result.
52
52
----
53
53
54
-
You should notice the new line `Recorded preimage for FILE` in there.
55
-
Otherwise it should look exactly like a normal merge conflict.
56
-
At this point, `rerere` can tell us a few things.
57
-
Normally, you might run `git status` at this point to see what all conflicted:
54
+
Sie müssen dort die neue Zeile `Recorded preimage for FILE` beachten.
55
+
Das Übrige sollte genau wie ein normaler Merge-Konflikt aussehen.
56
+
An dieser Stelle kann `rerere` uns ein paar Dinge sagen.
57
+
Normalerweise könnten Sie an diesem Punkt `git status` ausführen, um alle Konflikte zu sehen:
58
58
59
59
[source,console]
60
60
----
@@ -68,15 +68,15 @@ $ git status
68
68
#
69
69
----
70
70
71
-
However, `git rerere` will also tell you what it has recorded the pre-merge state for with `git rerere status`:
71
+
Allerdings wird Ihnen `git rerere` auch mitteilen, wozu es den Status vor dem Merge (engl. pre-merge state) mit `git rerere status` aufgezeichnet hat:
72
72
73
73
[source,console]
74
74
----
75
75
$ git rerere status
76
76
hello.rb
77
77
----
78
78
79
-
And `git rerere diff` will show the current state of the resolution -- what you started with to resolve and what you've resolved it to.
79
+
Ein `git rerere diff` zeigt den aktuellen Status der Lösung – womit Sie angefangen haben und welche Lösung Sie gefunden haben.
80
80
81
81
[source,console]
82
82
----
@@ -99,7 +99,7 @@ $ git rerere diff
99
99
end
100
100
----
101
101
102
-
Also (and this isn't really related to `rerere`), you can use `git ls-files -u` to see the conflicted files and the before, left and right versions:
102
+
Außerdem (und das hat nicht wirklich etwas mit `rerere` zu tun) können Sie `git ls-files -u` verwenden, um sich die in Konflikt stehenden Dateien und die vorherigen, verbliebenen und richtigen Versionen anzusehen:
Now you can resolve it to just be `puts 'hola mundo'` and you can run `git rerere diff` again to see what rerere will remember:
112
+
Jetzt können Sie auflösen, indem Sie einfach `puts 'hola mundo'` eingeben. Dann können Sie noch einmal `git rerere diff` starten, um zu sehen, woran rerere sich erinnern wird:
113
113
114
114
[source,console]
115
115
----
@@ -129,9 +129,9 @@ $ git rerere diff
129
129
end
130
130
----
131
131
132
-
So that basically says, when Git sees a hunk conflict in a `hello.rb` file that has ``hello mundo'' on one side and ``hola world'' on the other, it will resolve it to ``hola mundo''.
132
+
Das heißt im Grunde genommen: wenn Git in einer `hello.rb` Datei, die „hello mundo“ auf der einen Seite und „hola world“ auf der anderen Seite enthält, einen komplizierten Konflikt erkennt, wird es ihn zu „hola mundo“ auflösen.
133
133
134
-
Now we can mark it as resolved and commit it:
134
+
Jetzt können wir ihn als gelöst markieren und committen:
135
135
136
136
[source,console]
137
137
----
@@ -141,21 +141,21 @@ Recorded resolution for 'hello.rb'.
141
141
[master 68e16e5] Merge branch 'i18n'
142
142
----
143
143
144
-
You can see that it "Recorded resolution for FILE".
144
+
Sie können sehen, dass es die „Lösung für DATEI gespeichert hat“ (Recorded resolution for FILE).
145
145
146
146
image::images/rerere2.png[]
147
147
148
-
Now, let's undo that merge and then rebase it on top of our `master` branch instead.
149
-
We can move our branch back by using `git reset` as we saw in <<ch07-git-tools#_git_reset>>.
148
+
Machen wir jetzt diesen Merge rückgängig und legen ihn stattdessen dann auf unseren Branch `master`.
149
+
Wir können unseren Branch zurückversetzen, indem wir `git reset` anwenden, wie wir es in <<ch07-git-tools#_git_reset>> beschrieben haben.
150
150
151
151
[source,console]
152
152
----
153
153
$ git reset --hard HEAD^
154
154
HEAD is now at ad63f15 i18n the hello
155
155
----
156
156
157
-
Our merge is undone.
158
-
Now let's rebase the topic branch.
157
+
Unser Merge ist aufgehoben.
158
+
Lassen Sie uns jetzt den Topic-Branch rebasen.
159
159
160
160
[source,console]
161
161
----
@@ -174,8 +174,8 @@ Failed to merge in the changes.
174
174
Patch failed at 0001 i18n one word
175
175
----
176
176
177
-
Now, we got the same merge conflict like we expected, but take a look at the `Resolved FILE using previous resolution` line.
178
-
If we look at the file, we'll see that it's already been resolved, there are no merge conflict markers in it.
177
+
Nun haben wir den erwarteten Merge-Konflikt, aber schauen Sie sich die Zeile `Resolved FILE using previous resolution` an.
178
+
Wenn wir die Datei betrachten, sehen wir, dass der Konflikt bereits gelöst ist, es gibt keine Marker für den Merge-Konflikt in der Datei.
179
179
180
180
[source,ruby]
181
181
----
@@ -186,7 +186,7 @@ def hello
186
186
end
187
187
----
188
188
189
-
Also, `git diff` will show you how it was automatically re-resolved:
189
+
Zudem wird Ihnen `git diff` zeigen, wie es automatisch erneut gelöst wurde:
190
190
191
191
[source,console]
192
192
----
@@ -207,7 +207,7 @@ index a440db6,54336ba..0000000
207
207
208
208
image::images/rerere3.png[]
209
209
210
-
You can also recreate the conflicted file state with `git checkout`:
210
+
Sie können den Status der Konfliktdatei auch mit `git checkout` wiederherstellen:
211
211
212
212
[source,console]
213
213
----
@@ -224,8 +224,8 @@ def hello
224
224
end
225
225
----
226
226
227
-
We saw an example of this in <<ch07-git-tools#_advanced_merging>>.
228
-
For now though, let's re-resolve it by just running `git rerere` again:
227
+
Ein Beispiel dafür haben wir in <<ch07-git-tools#_advanced_merging>> kennengelernt.
228
+
Vorerst sollten wir das Problem allerdings dadurch lösen, dass wir `git rerere` noch einmal starten:
229
229
230
230
[source,console]
231
231
----
@@ -239,8 +239,8 @@ def hello
239
239
end
240
240
----
241
241
242
-
We have re-resolved the file automatically using the `rerere` cached resolution.
243
-
You can now add and continue the rebase to complete it.
242
+
Wir haben die Datei automatisch mit der mit `rerere` zwischengespeicherten Lösung erneut gelöst.
243
+
Sie können das nun hinzufügen und den Rebase fortsetzen, um ihn fertigzustellen.
244
244
245
245
[source,console]
246
246
----
@@ -249,4 +249,4 @@ $ git rebase --continue
249
249
Applying: i18n one word
250
250
----
251
251
252
-
So, if you do a lot of re-merges, or want to keep a topic branch up to date with your `master` branch without a ton of merges, or you rebase often, you can turn on `rerere` to help your life out a bit.
252
+
Wenn Sie also viele Re-Merges machen oder einen Topic-Branch mit Ihrem Branch `master` aktuell halten wollen, ohne dass eine Unmenge von Merges durchgeführt wird oder wenn Sie häufig einen Rebase machen, sollten Sie `rerere` aktivieren, um sich das Leben ein wenig leichter zu machen.
0 commit comments