Skip to content

Commit b9013f5

Browse files
committed
Translated section 10.3
1 parent 39fc40e commit b9013f5

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed
Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[[_git_refs]]
2-
=== Git References
2+
=== Αναφορές του Git
33

4-
You can run something like `git log 1a410e` to look through your whole history, but you still have to remember that `1a410e` is the last commit in order to walk that history to find all those objects.
5-
You need a file in which you can store the SHA-1 value under a simple name so you can use that pointer rather than the raw SHA-1 value.
4+
Μπορούμε να εκτελέσουμε κάτι σαν το `git log 1a410e` για να δούμε όλο το ιστορικό μας, αλλά πρέπει ακόμα να θυμόμαστε ότι η `1a410e` είναι η τελευταία υποβολή, για να διασχίσουμε εκείνο το ιστορικό και να βρούμε όλα αυτά τα αντικείμενα.
5+
Χρειαζόμαστε ένα αρχείο στο οποίο μπορούμε να αποθηκεύσουμε την τιμή SHA-1 με ένα απλό όνομα, ώστε να μπορούμε να χρησιμοποιήσουμε αυτόν τον δείκτη και όχι την τιμή SHA-1.
66

7-
In Git, these are called ``references'' or ``refs''; you can find the files that contain the SHA-1 values in the `.git/refs` directory.
8-
In the current project, this directory contains no files, but it does contain a simple structure:
7+
Στο Git, αυτά ονομάζονται ``αναφορές'' (references) ή ``refs''· μπορούμε να βρούμε τα αρχεία που περιέχουν τις τιμές SHA-1 στον κατάλογο `.git/refs`.
8+
Στο τρέχον έργο, αυτός ο κατάλογος δεν περιέχει αρχεία, αλλά περιέχει μια απλή δομή:
99

1010
[source,console]
1111
----
@@ -16,14 +16,14 @@ $ find .git/refs
1616
$ find .git/refs -type f
1717
----
1818

19-
To create a new reference that will help you remember where your latest commit is, you can technically do something as simple as this:
19+
Για να δημιουργήσουμε μια νέα αναφορά που θα μας βοηθήσει να θυμόμαστε πού είναι η τελευταία μας υποβολή, τεχνικά μπορούμε να κάνουμε κάτι τόσο απλό όπως το εξής:
2020

2121
[source,console]
2222
----
2323
$ echo "1a410efbd13591db07496601ebc7a059dd55cfe9" > .git/refs/heads/master
2424
----
2525

26-
Now, you can use the head reference you just created instead of the SHA-1 value in your Git commands:
26+
Τώρα μπορούμε να χρησιμοποιήσουμε την αναφορά κεφαλής που μόλις δημιουργήσαμε αντί της τιμής SHA-1 στις εντολές Git:
2727

2828
[source,console]
2929
----
@@ -33,23 +33,23 @@ cac0cab538b970a37ea1e769cbbde608743bc96d second commit
3333
fdf4fc3344e67ab068f836878b6c4951e3b15f3d first commit
3434
----
3535

36-
You aren't encouraged to directly edit the reference files.
37-
Git provides a safer command to do this if you want to update a reference called `update-ref`:
36+
Καλό θα είναι να μην επεξεργαζόμαστε απευθείας τα αρχεία αναφορών.
37+
Το Git παρέχει μία ασφαλέστερη εντολή εάν θέλουμε να ενημερώσουμε μια αναφορά, την `update-ref`,:
3838

3939
[source,console]
4040
----
4141
$ git update-ref refs/heads/master 1a410efbd13591db07496601ebc7a059dd55cfe9
4242
----
4343

44-
That's basically what a branch in Git is: a simple pointer or reference to the head of a line of work.
45-
To create a branch back at the second commit, you can do this:
44+
Αυτό βασικά είναι τι είναι ένας κλάδος στο Git: ένας απλός δείκτης ή μια αναφορά στην κεφαλή μιας γραμμής εργασίας.
45+
Για να δημιουργήσουμε έναν κλάδο πίσω στη δεύτερη υποβολή, μπορούμε να το κάνουμε το εξής:
4646

4747
[source,console]
4848
----
4949
$ git update-ref refs/heads/test cac0ca
5050
----
5151

52-
Your branch will contain only work from that commit down:
52+
Ο κλάδος μας θα περιέχει μόνο εργασίες από αυτήν την υποβολή και μετά:
5353

5454
[source,console]
5555
----
@@ -58,49 +58,49 @@ cac0cab538b970a37ea1e769cbbde608743bc96d second commit
5858
fdf4fc3344e67ab068f836878b6c4951e3b15f3d first commit
5959
----
6060

61-
Now, your Git database conceptually looks something like this:
61+
Τώρα, η βάση δεδομένων του Git μοιάζει με αυτό:
6262

63-
.Git directory objects with branch head references included.
64-
image::images/data-model-4.png[Git directory objects with branch head references included.]
63+
.Αντικείμενα του καταλόγου του Git συμπεριλαμβάνομένων αναφορών κεφαλής κλάδου.
64+
image::images/data-model-4.png[Αντικείμενα του καταλόγου του Git συμπεριλαμβάνομένων αναφορών κεφαλής κλάδου.]
6565

66-
When you run commands like `git branch (branchname)`, Git basically runs that `update-ref` command to add the SHA-1 of the last commit of the branch you're on into whatever new reference you want to create.
66+
Όταν εκτελούμε εντολές όπως η `git branch <όνομα_κλάδου>`, το Git βασικά τρέχει αυτήν την εντολή `update-ref` για να προσθέσει τον αριθμό SHA-1 της τελευταίας υποβολής του κλάδου στον οποίο βρισκόμαστε σε οποιαδήποτε νέα αναφορά θέλουμε να δημιουργήσουμε.
6767

6868
[[_the_head]]
69-
==== The HEAD
69+
==== Ο HEAD
7070

71-
The question now is, when you run `git branch (branchname)`, how does Git know the SHA-1 of the last commit?
72-
The answer is the HEAD file.
71+
Το ερώτημα τώρα είναι, όταν τρέχουμε την `git branch <όνομα_κλάδου>, πώς γνωρίζει το Git τον αριθμό SHA-1 της τελευταίας υποβολής;
72+
Η απάντηση είναι το αρχείο HEAD.
7373

74-
The HEAD file is a symbolic reference to the branch you're currently on.
75-
By symbolic reference, we mean that unlike a normal reference, it doesn’t generally contain a SHA-1 value but rather a pointer to another reference.
76-
If you look at the file, you'll normally see something like this:
74+
Το αρχείο HEAD είναι συμβολική αναφορά στον κλάδο στο οποίο βρισκόμαστε.
75+
Με συμβολική αναφορά, εννοούμε ότι σε αντίθεση με μια κανονική αναφορά, δεν περιέχει γενικά μια τιμή SHA-1, αλλά έναν δείκτη σε μια άλλη αναφορά.
76+
Εάν κοιτάξουμε το αρχείο, θα δούμε κάτι τέτοιο:
7777

7878
[source,console]
7979
----
8080
$ cat .git/HEAD
8181
ref: refs/heads/master
8282
----
8383

84-
If you run `git checkout test`, Git updates the file to look like this:
84+
Αν εκτελέσουμε την `git checkout test`, το Git ενημερώνει το αρχείο ώστε να φαίνεται ως εξής:
8585

8686
[source,console]
8787
----
8888
$ cat .git/HEAD
8989
ref: refs/heads/test
9090
----
9191

92-
When you run `git commit`, it creates the commit object, specifying the parent of that commit object to be whatever SHA-1 value the reference in HEAD points to.
92+
Όταν εκτελούμε την `git commit`, δημιουργεί το αντικείμενο υποβολής, ορίζοντας τον γονέα του αντικειμένου υποβολής να είναι όποια τιμή SHA-1 δείχνει η αναφορά στον HEAD.
9393

94-
You can also manually edit this file, but again a safer command exists to do so: `symbolic-ref`.
95-
You can read the value of your HEAD via this command:
94+
Μπορούμε επίσης να επεξεργαστούμε χειροκίνητα αυτό το αρχείο, αλλά και πάλι υπάρχει μια ασφαλέστερη εντολή: `symbolic-ref`.
95+
Μπορούμε να διαβάσουμε την τιμή του HEAD μας μέσω αυτής της εντολής:
9696

9797
[source,console]
9898
----
9999
$ git symbolic-ref HEAD
100100
refs/heads/master
101101
----
102102

103-
You can also set the value of HEAD:
103+
Μπορούμε επίσης να ορίσουμε την τιμή του HEAD:
104104

105105
[source,console]
106106
----
@@ -109,48 +109,48 @@ $ cat .git/HEAD
109109
ref: refs/heads/test
110110
----
111111

112-
You can't set a symbolic reference outside of the refs style:
112+
Δεν μπορούμε να ορίσουμε μια συμβολική αναφορά εκτός του καταλόγου refs:
113113

114114
[source,console]
115115
----
116116
$ git symbolic-ref HEAD test
117117
fatal: Refusing to point HEAD outside of refs/
118118
----
119119

120-
==== Tags
120+
==== Ετικέτες
121121

122-
We just finished discussing Git's three main object types, but there is a fourth.
123-
The tag object is very much like a commit object – it contains a tagger, a date, a message, and a pointer.
124-
The main difference is that a tag object generally points to a commit rather than a tree.
125-
It's like a branch reference, but it never moves – it always points to the same commit but gives it a friendlier name.
122+
Μόλις ολοκληρώσαμε τη συζήτηση για τους τρεις κύριους τύπους αντικειμένων του Git, αλλά υπάρχει ένας τέταρτος.
123+
Το αντικείμενο ``ετικέτα'' μοιάζει πολύ με ένα αντικείμενο υποβολής --περιέχει μία ταμπέλα, μια ημερομηνία, ένα μήνυμα και έναν δείκτη.
124+
Η κύρια διαφορά είναι ότι ένα αντικείμενο ετικέτας γενικά οδηγεί σε υποβολή και όχι σε δέντρο.
125+
Είναι σαν αναφορά κλάδου, αλλά δεν μετακινείται ποτέ --δείχνει πάντοτε την ίδια υποβολή, αλλά δίνει ένα πιο φιλικό όνομα.
126126

127-
As discussed in <<_git_basics_chapter>>, there are two types of tags: annotated and lightweight.
128-
You can make a lightweight tag by running something like this:
127+
Όπως αναλύθηκε στην ενότητα <<_git_basics_chapter>>, υπάρχουν δύο τύποι ετικετών: επισημειωμένοι (annotated) και ελαφριές (lightweight).
128+
Μπορούμε να κάνουμε μια ελαφριά ετικέτα τρέχοντας κάτι σαν αυτό:
129129

130130
[source,console]
131131
----
132132
$ git update-ref refs/tags/v1.0 cac0cab538b970a37ea1e769cbbde608743bc96d
133133
----
134134

135-
That is all a lightweight tag is – a reference that never moves.
136-
An annotated tag is more complex, however.
137-
If you create an annotated tag, Git creates a tag object and then writes a reference to point to it rather than directly to the commit.
138-
You can see this by creating an annotated tag (`-a` specifies that it's an annotated tag):
135+
Μία ελαφριά ετικέτα είναι ακριβώς και μόνον αυτό --μια αναφορά που δεν κινείται ποτέ.
136+
Ωστόσο, μια επισημειωμένη ετικέτα είναι πιο περίπλοκη.
137+
Αν δημιουργήσουμε μια επισημειωμένη ετικέτα, το Git δημιουργεί ένα αντικείμενο ετικέτας και στη συνέχεια γράφει μια αναφορά που δείχνει σε αυτήν και όχι απευθείας στην υποβολή.
138+
Μπορούμε να το δούμε αυτό δημιουργώντας μια επισημειωμένη ετικέτα (η επιλογή `-a` καθορίζει ότι είναι μια ετικέτα σχολιασμένη):
139139

140140
[source,console]
141141
----
142142
$ git tag -a v1.1 1a410efbd13591db07496601ebc7a059dd55cfe9 -m 'test tag'
143143
----
144144

145-
Here's the object SHA-1 value it created:
145+
Εδώ είναι το αντικείμενο SHA-1 που δημιούργησε:
146146

147147
[source,console]
148148
----
149149
$ cat .git/refs/tags/v1.1
150150
9585191f37f7b0fb9444f35a9bf50de191beadc2
151151
----
152152

153-
Now, run the `cat-file` command on that SHA-1 value:
153+
Τώρα, ας εκτελέσουμε την εντολή `cat-file` στην τιμή SHA-1:
154154

155155
[source,console]
156156
----
@@ -163,23 +163,23 @@ tagger Scott Chacon <[email protected]> Sat May 23 16:48:58 2009 -0700
163163
test tag
164164
----
165165

166-
Notice that the object entry points to the commit SHA-1 value that you tagged.
167-
Also notice that it doesn't need to point to a commit; you can tag any Git object.
168-
In the Git source code, for example, the maintainer has added their GPG public key as a blob object and then tagged it.
169-
You can view the public key by running this in a clone of the Git repository:
166+
Παρατηρούμε ότι το αντικείμενο δείχνει στην τιμή SHA-1 της υποβολής που έχουμε επισημάνει.
167+
Επίσης παρατηρούμε ότι δεν είναι απαραίτητο να δείχνει σε μια υποβολή· μπορούμε να βάλουμε ετικέτα σε οποιοδήποτε αντικείμενο Git.
168+
Στον πηγαίο κώδικα Git, για παράδειγμα, ο συντηρητής έχει προσθέσει το δημόσιο κλειδί GPG ως αντικείμενο blob και έπειτα του προσάρτησε μία ετικέτα.
169+
Μπορούμε να δούμε το δημόσιο κλειδί τρέχοντας αυτό σε έναν κλώνο του αποθετηρίου Git:
170170

171171
[source,console]
172172
----
173173
$ git cat-file blob junio-gpg-pub
174174
----
175175

176-
The Linux kernel repository also has a non-commit-pointing tag object – the first tag created points to the initial tree of the import of the source code.
176+
Το αποθετήριο του πυρήνα του Linux διαθέτει επίσης ένα αντικείμενο ετικέτας που δεν δείχνει σε υποβολή --η πρώτη ετικέτα που δημιουργήθηκε δείχνει στο αρχικό δέντρο της εισαγωγής του πηγαίου κώδικα.
177177

178-
==== Remotes
178+
==== Απομακρυσμένες αναφορές
179179

180-
The third type of reference that you'll see is a remote reference.
181-
If you add a remote and push to it, Git stores the value you last pushed to that remote for each branch in the `refs/remotes` directory.
182-
For instance, you can add a remote called `origin` and push your `master` branch to it:
180+
Ο τρίτος τύπος αναφοράς που θα δούμε είναι μια απομακρυσμένη αναφορά.
181+
Εάν προσθέσουμε ένα απομακρυσμένο αποθετήριο και ωθήσουμε σε αυτό, το Git αποθηκεύει την τιμή που ωθήσαμε τελευταία σε αυτό το απομακρυσμένο αποθετήριο για κάθε κλάδο στον κατάλογο `refs/remotes`.
182+
Για παράδειγμα, μπορούμε να προσθέσουμε ένα απομακρυσμένο αποθετήριο που ονομάζεται `origin` και να ωθήσουμε τον κλάδο μας `master` σε αυτό:
183183

184184
[source,console]
185185
----
@@ -193,14 +193,14 @@ To [email protected]:schacon/simplegit-progit.git
193193
a11bef0..ca82a6d master -> master
194194
----
195195

196-
Then, you can see what the `master` branch on the `origin` remote was the last time you communicated with the server, by checking the `refs/remotes/origin/master` file:
196+
Στη συνέχεια, μπορούμε να δούμε πώς ήταν ο κλάδος `master` στο απομακρυσμένο αποθετήριο `origin` την τελευταία φορά που επικοινωνήσαμε με τον διακομιστή, ελέγχοντας το αρχείο `refs/remotes/origin/master`:
197197

198198
[source,console]
199199
----
200200
$ cat .git/refs/remotes/origin/master
201201
ca82a6dff817ec66f44342007202690a93763949
202202
----
203203

204-
Remote references differ from branches (`refs/heads` references) mainly in that they're considered read-only.
205-
You can `git checkout` to one, but Git won't point HEAD at one, so you'll never update it with a `commit` command.
206-
Git manages them as bookmarks to the last known state of where those branches were on those servers.
204+
Οι απομακρυσμένες αναφορές διαφέρουν από τους κλάδους (αναφορές `refs/heads`) κυρίως επειδή θεωρούνται μόνο για ανάγνωση.
205+
Μπορούμε να κάνουμε `git checkout` σε μία απομακρυσμένη αναφορά, αλλά το Git ποτέ δεν θα κάνει τον HEAD σε μία, συνεπώς ποτέ δεν θα την ενημερώσουμε με μια εντολή `commit`.
206+
Το Git τις διαχειρίζεται ως σελιδοδείκτες στην τελευταία γνωστή κατάσταση στην οποία βρίσκονταν εκείνοι οι κλάδοι σε αυτούς τους διακομιστές.

0 commit comments

Comments
 (0)