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
Throughout this book, we've used simple mappings from remote branches to local references, but they can be more complex.
5
-
Suppose you add a remote like this:
4
+
Σε αυτό το βιβλίο, χρησιμοποιήσαμε απλές απεικονίσεις από απομακρυσμένους κλάδους σε τοπικές αναφορές, αλλά οι απεικονίσεις είναι δυνατό να είναι πιο σύνθετες.
5
+
Ας υποθέσουμε ότι προσθέτουμε ένα απομακρυσμένο σύστημα όπως αυτό:
It adds a section to your `.git/config` file, specifying the name of the remote (`origin`), the URL of the remote repository, and the refspec for fetching:
12
+
Η παραπάνω προσθέτει μια ενότητα στο αρχείο `.git/config`, καθορίζοντας το όνομα του απομακρυσμένου αποθετηρίου (`origin`), τη διεύθυνση URL του και το refspec για την ανάκτηση:
13
13
14
14
[source,ini]
15
15
----
@@ -18,11 +18,11 @@ It adds a section to your `.git/config` file, specifying the name of the remote
18
18
fetch = +refs/heads/*:refs/remotes/origin/*
19
19
----
20
20
21
-
The format of the refspec is an optional `+`, followed by `<src>:<dst>`, where `<src>` is the pattern for references on the remote side and `<dst>` is where those references will be written locally.
22
-
The `+` tells Git to update the reference even if it isn't a fast-forward.
21
+
Η μορφή του refspec είναι ένα προαιρετικό `+`, ακολουθούμενο από `<src>:<dst>`, όπου `<src>` είναι το πρότυπο για αναφορές στην απομακρυσμένη πλευρά και `<dst>` είναι πού θα γραφούν οι αναφορές αυτές τοπικά.
22
+
Το `+` λέει στο Git να ενημερώσει την αναφορά ακόμα κι αν δεν πρόκειται για ταχυπροώθηση.
23
23
24
-
In the default case that is automatically written by a `git remote add` command, Git fetches all the references under `refs/heads/` on the server and writes them to `refs/remotes/origin/` locally.
25
-
So, if there is a `master` branch on the server, you can access the log of that branch locally via
24
+
Στην προεπιλεγμένη περίπτωση που γράφεται αυτόματα από μια εντολή `git remote add`, το Git συγκεντρώνει όλες τις αναφορές κάτω από τον `refs/heads/` του διακομιστή και τις γράφει στον `refs/remotes/origin/` τοπικά.
25
+
Επομένως, εάν υπάρχει ένας κλάδος `master` στον διακομιστή, μπορούμε να έχουμε πρόσβαση στο μητρώο αυτού του κλάδου τοπικά μέσω
They're all equivalent, because Git expands each of them to `refs/remotes/origin/master`.
34
+
Όλες είναι ισοδύναμες, διότι το Git επεκτείνει το καθένα σε `refs/remotes/origin/master`.
35
35
36
-
If you want Git instead to pull down only the `master` branch each time, and not every other branch on the remote server, you can change the fetch line to
36
+
Εάν θέλουμε το Git αντί να έλκει μόνο τον κλάδο `master` κάθε φορά και όχι κάθε άλλο κλάδο από τον απομακρυσμένο διακομιστή, μπορούμε να αλλάξουμε τη γραμμή παραλαβής σε
In this case, the master branch pull was rejected because it wasn't a fast-forward reference.
65
-
You can override that by specifying the `+` in front of the refspec.
64
+
Σε αυτήν την περίπτωση, η έλξη του κλάδου `master` απορρίφθηκε επειδή δεν ήταν αναφορά ταχυπροώθησης. Μπορούμε να παρακάμψουμε αυτήν τη συμπεριφορά βάζοντας το `+` μπροστά από το refspec.
66
65
67
-
You can also specify multiple refspecs for fetching in your configuration file.
68
-
If you want to always fetch the master and experiment branches, add two lines:
66
+
Μπορούμε επίσης να ορίσουμε πολλά refspec για ανάκτηση στο αρχείο ρυθμίσεων.
67
+
Αν θέλουμε πάντα να ανακτούμε τους κύριους και πειραματικούς κλάδους προσθέτουμε αυτές τις δύο γραμμές:
69
68
70
69
[source,ini]
71
70
----
@@ -75,15 +74,16 @@ If you want to always fetch the master and experiment branches, add two lines:
ΧΧΧΔεν μπορούμε να χρησιμοποιήσουμε μερικά σφαιρίδια στο μοτίβο, επομένως το παρακάτω δεν είναι έγκυρη έκφραση:
78
78
You can't use partial globs in the pattern, so this would be invalid:
79
79
80
80
[source]
81
81
----
82
82
fetch = +refs/heads/qa*:refs/remotes/origin/qa*
83
83
----
84
84
85
-
However, you can use namespaces (or directories) to accomplish something like that.
86
-
If you have a QA team that pushes a series of branches, and you want to get the master branch and any of the QA team's branches but nothing else, you can use a config section like this:
85
+
Πάντως, μπορούμε να χρησιμοποιήσουμε ονοματοχώρους (ή καταλόγους) για να πετύχουμε κάτι τέτοιο.
86
+
Εάν έχουμε μια ομάδα QA που ωθεί μια σειρά από κλάδους και θέλουμε να πάρουμε το κύριο κλάδο και οποιοδήποτε από τους κλάδους της ομάδας QA αλλά τίποτα άλλο, μπορούμε να χρησιμοποιήσουμε μια ενότητα config όπως αυτή:
87
87
88
88
[source,ini]
89
89
----
@@ -93,22 +93,22 @@ If you have a QA team that pushes a series of branches, and you want to get the
93
93
fetch = +refs/heads/qa/*:refs/remotes/origin/qa/*
94
94
----
95
95
96
-
If you have a complex workflow process that has a QA team pushing branches, developers pushing branches, and integration teams pushing and collaborating on remote branches, you can namespace them easily this way.
96
+
Εάν έχουμε μια πολύπλοκη ροή εργασίας που διαθέτει μια ομάδα QA που ωθεί κλάδους, προγραμματιστές που ωθούν κλάδους και ομάδες ενσωμάτωσης που ωθούν και συνεργάζονται σε απομακρυσμένα κλάδους, μπορούμε να τους χωρίσουμε σε ονοματοχώρους με αυτό τον τρόπο.
97
97
98
98
[[_pushing_refspecs]]
99
-
==== Pushing Refspecs
99
+
==== Ώθηση refspecs
100
100
101
-
It's nice that you can fetch namespaced references that way, but how does the QA team get their branches into a `qa/` namespace in the first place?
102
-
You accomplish that by using refspecs to push.
101
+
Είναι ωραίο ότι μπορούμε να ανακτήσουμε αναφορές εντός ονοματοχώρων με αυτόν τον τρόπο, αλλά πώς μπόρεσε η ομάδα QA να βάλει όλους τους κλάδους της σε έναν ονοματοχώρο `qa/`;
102
+
Αυτό το πετυχαίνουμε χρησιμοποιώντας refspec για να ωθήσουμε.
103
103
104
-
If the QA team wants to push their `master` branch to `qa/master` on the remote server, they can run
104
+
Εάν η ομάδα QA θέλει να ωθήσει τον κλάδο `master` στον `qa/master` στον απομακρυσμένο διακομιστή, μπορεί να τρέξει
105
105
106
106
[source,console]
107
107
----
108
108
$ git push origin master:refs/heads/qa/master
109
109
----
110
110
111
-
If they want Git to do that automatically each time they run `git push origin`, they can add a `push` value to their config file:
111
+
Αν θέλουν να το κάνει το Git αυτόματα κάθε φορά που τρέχουν την `git push origin`, μπορούν να προσθέσουν μια τιμή `push` στο αρχείο config:
112
112
113
113
[source,ini]
114
114
----
@@ -118,15 +118,16 @@ If they want Git to do that automatically each time they run `git push origin`,
118
118
push = refs/heads/master:refs/heads/qa/master
119
119
----
120
120
121
-
Again, this will cause a `git push origin` to push the local `master` branch to the remote `qa/master` branch by default.
121
+
Και πάλι, αυτό θα προκαλέσει μια `git push origin` να ωθήσει τον τοπικό κλάδο `master` στον απομακρυσμένο κλάδο `qa/master` εκ προεπιλογής.
122
122
123
-
==== Deleting References
123
+
==== Διαγραφή αναφορών
124
124
125
-
You can also use the refspec to delete references from the remote server by running something like this:
125
+
Μπορούμε επίσης να χρησιμοποιήσουμε το refspec για να διαγράψουμε αναφορές από τον απομακρυσμένο διακομιστή εκτελώντας κάτι σαν αυτό:
126
126
127
127
[source,console]
128
128
----
129
129
$ git push origin :topic
130
130
----
131
131
132
-
Because the refspec is `<src>:<dst>`, by leaving off the `<src>` part, this basically says to make the topic branch on the remote nothing, which deletes it.
132
+
Επειδή το refspec είναι `<src>:<dst>`, αν αφήσουμε το τμήμα `<src>`, αυτό ουσιαστικά λέει ``κάνε τον θεματικό κλάδο στο απομακρυσμένο αποθετήριο, τίποτα'', οπότε το διαγράφει.
0 commit comments