Skip to content

Commit 6ef7121

Browse files
committed
Merge branch 'master' of git://github.com/progit/progit
2 parents f8e16b1 + d4fc551 commit 6ef7121

File tree

63 files changed

+30217
-613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+30217
-613
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ latex/*
55
!latex/README
66
!latex/template.tex
77
!latex/config.yml
8-
zh/03-git-branching/01-chapter3.markdown~
8+
*~

cs/01-introduction/01-chapter1.markdown

+293
Large diffs are not rendered by default.

cs/02-git-basics/01-chapter2.markdown

+1,121
Large diffs are not rendered by default.

cs/03-git-branching/01-chapter3.markdown

+598
Large diffs are not rendered by default.

cs/04-git-server/01-chapter4.markdown

+710
Large diffs are not rendered by default.

cs/05-distributed-git/01-chapter5.markdown

+897
Large diffs are not rendered by default.

cs/06-git-tools/01-chapter6.markdown

+1,109
Large diffs are not rendered by default.

cs/07-customizing-git/01-chapter7.markdown

+875
Large diffs are not rendered by default.

cs/08-git-and-other-scms/01-chapter8.markdown

+681
Large diffs are not rendered by default.

cs/09-git-internals/01-chapter9.markdown

+976
Large diffs are not rendered by default.

de/01-introduction/01-chapter1.markdown

+66-68
Large diffs are not rendered by default.

de/02-git-basics/01-chapter2.markdown

+235-94
Large diffs are not rendered by default.

de/03-git-branching/01-chapter3.markdown

+14
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ At this stage, you’ll receive a call that another issue is critical and you ne
150150
3. After it’s tested, merge the hotfix branch, and push to production.
151151
4. Switch back to your original story and continue working.
152152

153+
### Branching Grundlagen ###
153154
### Basic Branching ###
154155

155156
Sagen wir, du hast an deinem Projekt gearbeitet und einige Commits bereits durchgeführt (siehe Abbildung 3-10).
@@ -159,38 +160,48 @@ Insert 18333fig0310.png
159160
Abbildung 3-10. Eine kurze, einfache Commit-Historie
160161
Figure 3-10. A short and simple commit history
161162

163+
Du hast dich entschiden, am Issue #53 des Issue-Tracking-Systems XYZ deiner Firma zuarbeiten. Um es klarzustellen: Git ist an kein spezifisches Issue-Tracking-Systems gebunden, aber weil Issue #53 ein wichtiges Thema ist, willst du daran arbeiten und erstellst eine neue Branch , um daran zu arbeiten. Um die Branch zu erstellen und gleichzeitig zu ihr umzuschalten, kannst du das Kommando 'git checkout' in Verbindung mitder Option '-b' verwenden:
162164
You’ve decided that you’re going to work on issue #53 in whatever issue-tracking system your company uses. To be clear, Git isn’t tied into any particular issue-tracking system; but because issue #53 is a focused topic that you want to work on, you’ll create a new branch in which to work. To create a branch and switch to it at the same time, you can run the `git checkout` command with the `-b` switch:
163165

164166
$ git checkout -b iss53
165167
Switched to a new branch "iss53"
166168

169+
Das ist die Kurzform von
167170
This is shorthand for
168171

169172
$ git branch iss53
170173
$ git checkout iss53
171174

175+
Abbildung 3-11 verdeutlicht das Ergebnis.
172176
Figure 3-11 illustrates the result.
173177

174178
Insert 18333fig0311.png
179+
Abbildung 3-11. Erstellung eines neuen Branch-Pointers
175180
Figure 3-11. Creating a new branch pointer
176181

182+
Du arbeitest an deiner Web-Site und machst ein paar Commits. Dabei bewegt sich die 'iss53' Branch vorwärts, da sie gerade deine aktuelle Branch ist (der HEAD Pointer verweist darauf, siehe Abbildung 3-12):
177183
You work on your web site and do some commits. Doing so moves the `iss53` branch forward, because you have it checked out (that is, your HEAD is pointing to it; see Figure 3-12):
178184

179185
$ vim index.html
180186
$ git commit -a -m 'added a new footer [issue 53]'
181187

182188
Insert 18333fig0312.png
189+
Abbildung 3-12. Die iss53 Branch hat sich mit deiner Arbeit weiterentwickelt.
183190
Figure 3-12. The iss53 branch has moved forward with your work.
184191

192+
Jetzt bekommst du einen Anruf, dass es ein Problem mit der Website gibt, und du musst es umgehend beheben. Mit Git musst die Problembehebung nicht zusammen mit der Arbeit an 'iss53' einspielen, und du musst auch keinen Aufwand in das Zurücksetzen der Änderungen stecken, bevor du die Problembehebung in die Produktion einspielen kannst. Alles was du machen musst, ist zurück zur master Branch schalten.
185193
Now you get the call that there is an issue with the web site, and you need to fix it immediately. With Git, you don’t have to deploy your fix along with the `iss53` changes you’ve made, and you don’t have to put a lot of effort into reverting those changes before you can work on applying your fix to what is in production. All you have to do is switch back to your master branch.
186194

195+
Wie auch immer, bevor du das machst, ein Hinweis, wenn du nicht committete Sachen in deinem Arbeits- oder Staging-Verzeichnis hast, die einen Konflikt mit der Branch, zu der du schalten willst, hat, lässt dich Git nicht dorthin schalten. Am besten man hat einen sauberen Arbeitsstand, wenn man die Branch wechseln will. Es gibt Wege, um das zu umgehen (stashing und commit amending). Aber dazu später mehr. Im Moment solltest du deine Änderungen committen und dann zur master Branch wechseln:
187196
However, before you do that, note that if your working directory or staging area has uncommitted changes that conflict with the branch you’re checking out, Git won’t let you switch branches. It’s best to have a clean working state when you switch branches. There are ways to get around this (namely, stashing and commit amending) that we’ll cover later. For now, you’ve committed all your changes, so you can switch back to your master branch:
188197

189198
$ git checkout master
190199
Switched to branch "master"
191200

201+
An dieser Stelle befindet sich dein Prjekt Arbeitsverzeichnis an exakt der gleichen Stelle, wie vor der Arbeit an 'iss53', und du kannst dich auf den Hotfix konzentrieren. Das ist ein wichtiger Aspekt, den man im Kopf behalten sollte: Git setzt dein Arbeitsverzeichnis immer auf den Stand, der dem Snapshot der aktuellen Branch entspricht. Es werden automatisch die entsprechenden Dateien hinzugefügt, gelöscht und modifiziert, damit die Arbeitskopie, wie nach deinem letzten Commit in dieser Branch aussieht.
192202
At this point, your project working directory is exactly the way it was before you started working on issue #53, and you can concentrate on your hotfix. This is an important point to remember: Git resets your working directory to look like the snapshot of the commit that the branch you check out points to. It adds, removes, and modifies files automatically to make sure your working copy is what the branch looked like on your last commit to it.
193203

204+
Als nächstes hast du einen Hotfix zu machen. Lass uns eine 'Hotfix' Branch erstellen, an der du bis zur Fertigstellung arbeitest (siehe Abbildung 3-13):
194205
Next, you have a hotfix to make. Let’s create a hotfix branch on which to work until it’s completed (see Figure 3-13):
195206

196207
$ git checkout -b 'hotfix'
@@ -201,8 +212,10 @@ Next, you have a hotfix to make. Let’s create a hotfix branch on which to work
201212
1 files changed, 0 insertions(+), 1 deletions(-)
202213

203214
Insert 18333fig0313.png
215+
Abbildung 3-13. Hotfix Branch verweist auf die master Branch zurück
204216
Figure 3-13. hotfix branch based back at your master branch point
205217

218+
Mach deine Tests, stell sicher, dass der Hotfix das macht, was du willst und führe ihn mit der master Branch zusammen, um diese wieder in die Produktion zu bringen. Du machst das mit dem Kommando 'git merge':
206219
You can run your tests, make sure the hotfix is what you want, and merge it back into your master branch to deploy to production. You do this with the `git merge` command:
207220

208221
$ git checkout master
@@ -212,6 +225,7 @@ You can run your tests, make sure the hotfix is what you want, and merge it back
212225
README | 1 -
213226
1 files changed, 0 insertions(+), 1 deletions(-)
214227

228+
Hast du die Nachricht "Fast forward" beim Zusammenführen gesehen? Da du auf die aktuelle Branch aufgesetzt hast und die Änderung eine direkte Weiterführung dieser war, hat Git den Pointer weitergestellt. Anders ausgedrückt, wenn zwischen zwei Branches kein Unterschied besteht oder nur eine davon eine Weiterentwicklung darstellt, bringt Git diese beiden wieder auf 'Linie' - das wird dann 'fast forward' genannt.
215229
You’ll notice the phrase "Fast forward" in that merge. Because the commit pointed to by the branch you merged in was directly upstream of the commit you’re on, Git moves the pointer forward. To phrase that another way, when you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together — this is called a "fast forward".
216230

217231
Your change is now in the snapshot of the commit pointed to by the `master` branch, and you can deploy your change (see Figure 3-14).

de/04-git-server/01-chapter4.markdown

+22
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,56 @@ Für den Fall, dass keine Bedenken bestehen, Code von externen Anbietern hosten
2020

2121
If you have no interest in running your own server, you can skip to the last section of the chapter to see some options for setting up a hosted account and then move on to the next chapter, where we discuss the various ins and outs of working in a distributed source control environment.
2222

23+
Wenn du kein Interesse am Betreiben eines eigenen Servers hast, kannst du zum letzten Absatz des Kapitels springen, um ein paar Möglichkeiten zum Einrichten eines gehosteten Accounts zu sehen. Im nächsten Kapitel diskutieren wir verschiedene Vorteile und Nachteile vom Arbeiten in einer verteilten Quellcode-Kontroll-Umgebung.
24+
2325
A remote repository is generally a _bare repository_ — a Git repository that has no working directory. Because the repository is only used as a collaboration point, there is no reason to have a snapshot checked out on disk; it’s just the Git data. In the simplest terms, a bare repository is the contents of your project’s `.git` directory and nothing else.
2426

27+
Ein externes Repository ist im Allgemeinen ein _einfaches Repository_ - ein Git Repository ohne Arbeitsverzeichnis. Weil das Repository nur als Zusammenarbeitspunkt genutzt wird, gibt es keinen Grund, einen Schnappschuss ausgecheckt auf der Festplatte zu haben; es sind nur die Git Daten. Mit einfachen Begriffen, ein einfaches Repository ist der Inhalt von deinem `.git` Verzeichnis in deinem Projekt und nichts anderes.
28+
2529
## The Protocols ##
30+
## Die Protokolle ##
2631

2732
Git can use four major network protocols to transfer data: Local, Secure Shell (SSH), Git, and HTTP. Here we’ll discuss what they are and in what basic circumstances you would want (or not want) to use them.
2833

34+
Git kann vier wichtige Netzwerk Protokolle zum Datentransfer benutzen: Lokal, Secure Shell (SSH), Git und HTTP. Hier wollen wir diskutieren, was diese Protokolle sind und unter welchen grundlegenden Gegebenheiten du sie benutzen möchtest (oder auch nicht).
35+
2936
It’s important to note that with the exception of the HTTP protocols, all of these require Git to be installed and working on the server.
3037

38+
Es ist wichtig zu beachten, mit der Ausnahme des HTTP-Protokolls, es ist Vorraussetzung, dass Git auf dem Server installiert sein muss und laufen muss.
39+
3140
### Local Protocol ###
41+
### Lokales Protokoll ###
3242

3343
The most basic is the _Local protocol_, in which the remote repository is in another directory on disk. This is often used if everyone on your team has access to a shared filesystem such as an NFS mount, or in the less likely case that everyone logs in to the same computer. The latter wouldn’t be ideal, because all your code repository instances would reside on the same computer, making a catastrophic loss much more likely.
3444

45+
Am einfachsten ist das _Lokale Protokoll_, wobei das externe Repository in einem anderen Verzeichnis auf der Festplatte ist. Das wird oft genutzt, wenn jeder aus deinem Team Zugriff zu einem gemeinsamen Dateisystem hat, zum Beispiel ein eingebundenes NFS, oder im unwahrscheinlicheren Fall jeder loggt sich auf bei dem gleichen Computer ein. Das letztere ist nicht ideal, weil alle Code Repository Instanzen auf dem selben Computer wären, ein katastrophaler Verlust wäre wahrscheinlicher.
46+
3547
If you have a shared mounted filesystem, then you can clone, push to, and pull from a local file-based repository. To clone a repository like this or to add one as a remote to an existing project, use the path to the repository as the URL. For example, to clone a local repository, you can run something like this:
3648

49+
Wenn du ein gemeinsames Dateisystem eingebunden hast, kannst du von einem lokalen Datei-basiertem Repository clonen, pushen und pullen. Um ein Repository wie dieses zu clonen, oder ein externes zu einem bestehenden Projekt hinzuzufügen, benutze den Pfad zu dem Repository als URL. Um zum Beispiel ein lokales Repository zu clonen kannst du einen Befehl wie diesen nutzen:
50+
3751
$ git clone /opt/git/project.git
3852

3953
Or you can do this:
4054

55+
Oder du kannst das machen:
56+
4157
$ git clone file:///opt/git/project.git
4258

4359
Git operates slightly differently if you explicitly specify `file://` at the beginning of the URL. If you just specify the path, Git tries to use hardlinks or directly copy the files it needs. If you specify `file://`, Git fires up the processes that it normally uses to transfer data over a network which is generally a lot less efficient method of transferring the data. The main reason to specify the `file://` prefix is if you want a clean copy of the repository with extraneous references or objects left out — generally after an import from another version-control system or something similar (see Chapter 9 for maintenance tasks). We’ll use the normal path here because doing so is almost always faster.
4460

61+
Git arbeitet etwas anders, wenn du am Anfang der URL ausdrücklich `file://` angibst. Wenn du nur den Pfad angibst, versucht Git harte Links zu benutzen oder Git kopiert direkt die benötigten Dateien. Wenn du `file://` angibst, startet Git den Prozess, den es normalerweise zum Übertragen von Daten über ein Netzwerk verwendet, dass ist gewöhnlich eine wesentlich ineffizientere Methode zum Übertragen der Daten. Der Hauptgrund das `file://`-Präfix anzugeben ist eine saubere Kopie von dem Repository mit fremden Referenzen oder fehlenden Objekten - generell nach einem Import von einem anderen Versionskontrollsystem oder etwas ähnliches (siehe Kapitel 9 für Wartungsarbeiten). Wir benutzen hier den normalen Pfad, weil das fast immer schneller ist.
62+
4563
To add a local repository to an existing Git project, you can run something like this:
4664

65+
Um ein lokales Repository zu einem existierenden Git Projekt hinzuzufügen, kannst du einen Befehl wie diesen ausführen:
66+
4767
$ git remote add local_proj /opt/git/project.git
4868

4969
Then, you can push to and pull from that remote as though you were doing so over a network.
5070

71+
Dann kannst du von einem externen Repository pushen und pullen, obwohl du das über ein Netzwerk machst.
72+
5173
#### The Pros ####
5274

5375
The pros of file-based repositories are that they’re simple and they use existing file permissions and network access. If you already have a shared filesystem to which your whole team has access, setting up a repository is very easy. You stick the bare repository copy somewhere everyone has shared access to and set the read/write permissions as you would for any other shared directory. We’ll discuss how to export a bare repository copy for this purpose in the next section, “Getting Git on a Server.”

0 commit comments

Comments
 (0)