Skip to content

Commit 0b97caf

Browse files
committed
Übersetzung fertig gestellt
1 parent 57a6843 commit 0b97caf

File tree

2 files changed

+48
-46
lines changed

2 files changed

+48
-46
lines changed

book/07-git-tools/sections/submodules.asc

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -783,17 +783,17 @@ $ git commit -am 'Fast forward to a common submodule child'
783783

784784
Damit wird dasselbe erreicht, aber zumindest können Sie auf diese Weise überprüfen, ob es wirklich funktioniert und Sie haben den Code in Ihrem Submodul-Verzeichnis, wenn Sie fertig sind.
785785

786-
==== Submodule Tips
786+
==== Tipps für Submodule
787787

788788
There are a few things you can do to make working with submodules a little easier.
789789

790-
===== Submodule Foreach
790+
===== Submodul Foreach
791791

792-
There is a `foreach` submodule command to run some arbitrary command in each submodule.
793-
This can be really helpful if you have a number of submodules in the same project.
792+
Es gibt das Submodul-Kommando `foreach`, um in jedem Submodul ein beliebiges Kommando auszuführen.
793+
Das kann wirklich hilfreich sein, wenn Sie mehrere Submodule im gleichen Projekt haben.
794794

795-
For example, let's say we want to start a new feature or do a bugfix and we have work going on in several submodules.
796-
We can easily stash all the work in all our submodules.
795+
Nehmen wir zum Beispiel an, wir wollen ein neues Feature starten oder einen Bugfix durchführen und arbeiten an mehreren Submodulen.
796+
Wir können leicht die gesamte Arbeit in all unseren Submodulen stashen.
797797

798798
[source,console]
799799
----
@@ -805,7 +805,7 @@ Saved working directory and index state WIP on stable: 82d2ad3 Merge from origin
805805
HEAD is now at 82d2ad3 Merge from origin/stable
806806
----
807807

808-
Then we can create a new branch and switch to it in all our submodules.
808+
Dann können wir einen neuen Branch erstellen und von allen unseren Submodulen zu diesem wechseln.
809809

810810
[source,console]
811811
----
@@ -816,8 +816,9 @@ Entering 'DbConnector'
816816
Switched to a new branch 'featureA'
817817
----
818818

819-
You get the idea.
820-
One really useful thing you can do is produce a nice unified diff of what is changed in your main project and all your subprojects as well.
819+
Sie verstehen die Idee dahinter?
820+
Eine wirklich sinnvolle Methode, die Ihnen hilft, ein gutes, einheitliches Diff zwischen den Änderungen in Ihrem Hauptprojekt und all Ihren Subprojekten zu erstellen.
821+
821822

822823
[source,console]
823824
----
@@ -855,13 +856,13 @@ index 1aaefb6..5297645 100644
855856
struct strbuf out = STRBUF_INIT;
856857
----
857858

858-
Here we can see that we're defining a function in a submodule and calling it in the main project.
859-
This is obviously a simplified example, but hopefully it gives you an idea of how this may be useful.
859+
Hier können Sie sehen, dass wir eine Funktion in einem Submodul definieren und sie im Hauptprojekt aufrufen.
860+
Das ist natürlich ein vereinfachtes Beispiel, aber es gibt Ihnen hoffentlich eine Vorstellung davon, wie hilfreich das sein könnte.
860861

861-
===== Useful Aliases
862+
===== Nützliche Aliase
862863

863-
You may want to set up some aliases for some of these commands as they can be quite long and you can't set configuration options for most of them to make them defaults.
864-
We covered setting up Git aliases in <<ch02-git-basics-chapter#_git_aliases>>, but here is an example of what you may want to set up if you plan on working with submodules in Git a lot.
864+
Vielleicht möchten Sie Aliase für manche dieser Befehle einrichten, da sie ziemlich lang sein können und Sie können für die meisten dieser Befehle keine Konfigurationsoptionen festlegen, um sie zu Standardeinstellungen zu machen.
865+
Wir haben die Einrichtung von Git-Aliasen in <<ch02-git-basics-chapter#_git_aliases>> behandelt, hier ist aber ein Beispiel dafür, was Sie vielleicht einrichten sollten, wenn Sie viel mit Submodulen in Git arbeiten wollen.
865866

866867
[source,console]
867868
----
@@ -870,16 +871,16 @@ $ git config alias.spush 'push --recurse-submodules=on-demand'
870871
$ git config alias.supdate 'submodule update --remote --merge'
871872
----
872873

873-
This way you can simply run `git supdate` when you want to update your submodules, or `git spush` to push with submodule dependency checking.
874+
Auf diese Weise können Sie einfach `git supdate` ausführen, wenn Sie Ihre Submodule aktualisieren wollen, oder `git spush`, um einen Push mit der Überprüfung der Submodul-Abhängigkeiten durchzuführen.
874875

875-
==== Issues with Submodules
876+
==== Probleme mit Submodulen
876877

877-
Using submodules isn't without hiccups, however.
878+
Die Verwendung von Submodulen ist jedoch nicht ohne Schwierigkeiten.
878879

879-
===== Switching branches
880+
===== Branches wechseln
880881

881-
For instance, switching branches with submodules in them can also be tricky with Git versions older than Git 2.13.
882-
If you create a new branch, add a submodule there, and then switch back to a branch without that submodule, you still have the submodule directory as an untracked directory:
882+
So kann beispielsweise das Wechseln von Branches mit darin enthaltenen Submodulen bei älteren Git-Versionen (vor Git 2.13) ebenfalls knifflig sein.
883+
Wenn Sie einen neuen Branch erstellen, dort ein Submodul hinzufügen und dann wieder zu einem Branch ohne dieses Submodul wechseln, haben Sie darin das Submodul-Verzeichnis immer noch als ungetracktes Verzeichnis:
883884

884885
[source,console]
885886
----
@@ -915,8 +916,8 @@ Untracked files:
915916
nothing added to commit but untracked files present (use "git add" to track)
916917
----
917918

918-
Removing the directory isn't difficult, but it can be a bit confusing to have that in there.
919-
If you do remove it and then switch back to the branch that has that submodule, you will need to run `submodule update --init` to repopulate it.
919+
Das Entfernen des Verzeichnisses ist nicht schwierig, aber es kann etwas verwirrend sein, das darin enthalten zu haben.
920+
Wenn Sie es entfernen und dann wieder zu dem Branch wechseln, der dieses Submodul besitzt, müssen Sie `submodule update --init` ausführen, um es neu zu befüllen.
920921

921922
[source,console]
922923
----
@@ -935,9 +936,9 @@ $ ls CryptoLibrary/
935936
Makefile includes scripts src
936937
----
937938

938-
Again, not really very difficult, but it can be a little confusing.
939+
Auch das ist nicht wirklich schwierig, aber es kann ein wenig verwirrend sein.
939940

940-
Newer Git versions (Git >= 2.13) simplify all this by adding the `--recurse-submodules` flag to the `git checkout` command, which takes care of placing the submodules in the right state for the branch we are switching to.
941+
Neuere Git-Versionen (ab Git 2.13) vereinfachen das alles, indem sie das Flag `--recurse-submodules` zum Befehl `git checkout` hinzufügen, der sich darum kümmert, die Submodule in den richtigen Zustand für den Branch zu bringen, auf den wir wechseln.
941942

942943
[source,console]
943944
----
@@ -967,21 +968,22 @@ Your branch is up-to-date with 'origin/master'.
967968
nothing to commit, working tree clean
968969
----
969970

970-
Using the `--recurse-submodules` flag of `git checkout` can also be useful when you work on several branches in the superproject, each having your submodule pointing at different commits.
971-
Indeed, if you switch between branches that record the submodule at different commits, upon executing `git status` the submodule will appear as ``modified'', and indicate ``new commits''. That is because the submodule state is by default not carried over when switching branches.
971+
Die Verwendung des Flags `--recurse-submodules` mit `git checkout` kann auch praktisch sein, wenn Sie auf mehreren Branches im Hauptprojekt arbeiten, wobei jedes Ihrer Submodule auf unterschiedliche Commits zeigt.
972+
Tatsächlich, wenn Sie zwischen den Branches wechseln, die das Submodul bei verschiedenen Commits erfassen, wird das Submodul bei der Ausführung von `git status` als „modifiziert“ erscheinen und „neue Commits“ anzeigen.
973+
Das liegt daran, dass der Submodul-Status beim Wechseln der Branches standardmäßig nicht mit übertragen wird.
972974

973-
This can be really confusing, so it's a good idea to always `git checkout --recurse-submodules` when your project has submodules.
974-
(For older Git versions that do not have the `--recurse-submodules` flag, after the checkout you can use `git submodule update --init --recursive` to put the submodules in the right state.)
975+
Das kann äußerst verwirrend sein, deshalb ist es besser, immer den Befehl `git checkout --recurse-submodules` zu verwenden, wenn Ihr Projekt Submodule hat.
976+
(Für ältere Git-Versionen, die das Flag `--recurse-submodules` nicht kennen, verwenden Sie nach dem Auschecken `git submodule update --init --recursive`, um die Submodule in den richtigen Zustand zu versetzen.)
975977

976-
Luckily, you can tell Git (>=2.14) to always use the `--recurse-submodules` flag by setting the configuration option `submodule.recurse`: `git config submodule.recurse true`.
977-
As noted above, this will also make Git recurse into submodules for every command that has a `--recurse-submodules` option (except `git clone`).
978+
Glücklicherweise können Sie Git (2.14) anweisen, immer das Flag `--recurse-submodules` zu verwenden, indem Sie die Konfigurationsoption `submodule.recurse` setzen mit: `git config submodule.recurse true`.
979+
Wie oben schon erwähnt, wird das auch dazu führen, dass Git in Submodulen jeden Befehl entsprechend umwandelt, der eine `--recurse-submodules` Option hat (außer bei `git clone`).
978980

979-
===== Switching from subdirectories to submodules
981+
===== Wechseln von Unterverzeichnissen zu Submodulen
980982

981-
The other main caveat that many people run into involves switching from subdirectories to submodules.
982-
If you've been tracking files in your project and you want to move them out into a submodule, you must be careful or Git will get angry at you.
983-
Assume that you have files in a subdirectory of your project, and you want to switch it to a submodule.
984-
If you delete the subdirectory and then run `submodule add`, Git yells at you:
983+
Die andere Warnung, die viele Anwender zu beachten haben, ist der Wechsel von Unterverzeichnissen zu Submodulen.
984+
Wenn Sie Dateien in Ihrem Projekt getrackt haben und sie in ein Submodul verschieben wollen, müssen Sie vorsichtig sein, sonst wird Git Ihnen das nicht verzeihen.
985+
Angenommen, Sie haben Dateien in einem Unterverzeichnis Ihres Projekts und wollen es in ein Untermodul verschieben.
986+
Wenn Sie das Unterverzeichnis löschen und dann `submodule add` ausführen, wird Git Sie etwa so anbrüllen:
985987

986988
[source,console]
987989
----
@@ -990,8 +992,8 @@ $ git submodule add https://github.com/chaconinc/CryptoLibrary
990992
'CryptoLibrary' already exists in the index
991993
----
992994

993-
You have to unstage the `CryptoLibrary` directory first.
994-
Then you can add the submodule:
995+
Sie müssen zuerst das `CryptoLibrary` Verzeichnis aus der Staging-Area entfernen (engl. unstage).
996+
Danach können Sie das Submodul hinzufügen:
995997

996998
[source,console]
997999
----
@@ -1005,8 +1007,8 @@ Unpacking objects: 100% (11/11), done.
10051007
Checking connectivity... done.
10061008
----
10071009

1008-
Now suppose you did that in a branch.
1009-
If you try to switch back to a branch where those files are still in the actual tree rather than a submodule – you get this error:
1010+
Nehmen wir jetzt an, Sie hätten das in einer Branch getan.
1011+
Wenn Sie versuchen, wieder zu einer Branch zu wechseln, in der sich diese Dateien noch im aktuellen Verzeichnisbaum und nicht in einem Submodul befinden, erhalten Sie diesen Fehler:
10101012

10111013
[source,console]
10121014
----
@@ -1019,7 +1021,7 @@ Please move or remove them before you can switch branches.
10191021
Aborting
10201022
----
10211023

1022-
You can force it to switch with `checkout -f`, but be careful that you don't have unsaved changes in there as they could be overwritten with that command.
1024+
Sie können den Wechsel mit `checkout -f` erzwingen, aber achten Sie darauf, dass dort keine ungesicherten Änderungen enthalten sind, weil diese mit dem Befehl überschrieben werden könnten.
10231025

10241026
[source,console]
10251027
----
@@ -1028,10 +1030,10 @@ warning: unable to rmdir CryptoLibrary: Directory not empty
10281030
Switched to branch 'master'
10291031
----
10301032

1031-
Then, when you switch back, you get an empty `CryptoLibrary` directory for some reason and `git submodule update` may not fix it either.
1032-
You may need to go into your submodule directory and run a `git checkout .` to get all your files back.
1033-
You could run this in a `submodule foreach` script to run it for multiple submodules.
1033+
Dann, wenn Sie zurückwechseln, erhalten Sie aus bestimmten Gründen ein leeres `CryptoLibrary` Verzeichnis, und `git submodule update` kann es auch nicht beheben.
1034+
Möglicherweise müssen Sie in Ihr Submodul-Verzeichnis gehen und `git checkout .` ausführen, um alle Ihre Dateien zurück zu bekommen.
1035+
Sie könnten das mit einem `submodule foreach` Skript erledigen, um es für mehrere Submodule anzuwenden.
10341036

1035-
It's important to note that submodules these days keep all their Git data in the top project's `.git` directory, so unlike much older versions of Git, destroying a submodule directory won't lose any commits or branches that you had.
1037+
Es ist wichtig zu wissen, dass Submodule heute alle ihre Git-Daten im `.git`-Verzeichnis des Hauptprojekts speichern, so dass im Gegensatz zu vielen älteren Git-Versionen, mit dem Löschen eines Submodul-Verzeichnisses keine Commits oder Branches verloren gehen, die Sie zuvor schon hatten.
10361038

1037-
With these tools, submodules can be a fairly simple and effective method for developing on several related but still separate projects simultaneously.
1039+
Mit diesen Werkzeugen können Submodule eine ziemlich einfache und effektive Methode sein, um an mehreren verwandten, aber dennoch unterschiedlichen Projekten gleichzeitig zu entwickeln.

status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"sections/searching.asc": 100,
7474
"sections/signing.asc": 100,
7575
"sections/stashing-cleaning.asc": 100,
76-
"sections/submodules.asc": 20,
76+
"sections/submodules.asc": 100,
7777
"sections/subtree-merges.asc": 100
7878
},
7979
"08-customizing-git": {

0 commit comments

Comments
 (0)