Github tutorial: Πρέπει να γνωρίζετε αυτά τα βασικά στοιχεία
Σε αυτό το σεμινάριο θα σας παρουσιάσουμε στο Github. Το Github είναι μια πλατφόρμα όπου μπορείτε να διαχειριστείτε, να αποθηκεύσετε και να ακολουθήσετε τα έργα και τους χρήστες του Git.
Github tutorial: τι είναι git;
Προτού κατανοήσετε τι είναι ο Github, πρέπει πρώτα να καταλάβετε την έννοια του Git:
- Το Git είναι ένα λογισμικό διαχείρισης έκδοσης για έργα. Μπορείτε να το χρησιμοποιήσετε για να μεταβείτε απλά σε παλιούς πάγκους ή να εργαστείτε σε ένα έργο με πολλούς ανθρώπους.
- Μπορείτε είτε να χρησιμοποιήσετε το Git στη γραμμή εντολών του λειτουργικού σας συστήματος είτε στο Github Desktop, έναν πελάτη Git με γραφικό περιβάλλον χρήστη. Πρέπει να γνωρίζετε τις ακόλουθες εντολές κατά τη χρήση του Git:
- git clone [URL]: Κλωνοποιήστε ένα αποθετήριο Git από τη διεύθυνση URL στον τοπικό σας υπολογιστή.
- git init: Αρχικοποιήστε ένα έργο Git τοπικά. Μπορείτε να το φορτώσετε προαιρετικά αργότερα στο Github ή σε άλλο κεντρικό υπολογιστή.
- git add: Προσθήκη αρχείων στη λίστα παρακολούθησης. Αυτό το βήμα είναι υποχρεωτικό για να φορτώσετε στη συνέχεια το έργο σας στο χώρο αποθήκευσης.
- git commit: δεσμεύστε τις αλλαγές. Αυτό είναι ένα περίπτερο στο οποίο μπορείτε να επιστρέψετε ανά πάσα στιγμή. Επαφές αρχείων πριν να μπορούν να σταλούν σε απομακρυσμένο αποθετήριο.
- git push: Με ένα πάτημα στέλνετε όλες τις δεσμεύσεις στο απομακρυσμένο αποθετήριο στους διακομιστές του Github ή στον επιλεγμένο άλλο παροχέα.
Tutorial: τι είναι github;
Το Github είναι ο οικοδεσπότης για τα έργα σας Git και έχει παρόμοιες ιδιότητες με ένα κοινωνικό δίκτυο.
- Με το Git μπορείτε να έχετε πρόσβαση στα έργα που έχετε αποθηκεύσει στο Github από οπουδήποτε.
- Τα αποθετήρια που είναι αποθηκευμένα στο Github είναι πάντα δημόσια. Έτσι, άλλοι χρήστες μπορούν να δουν τα έργα σας. Τα ιδιωτικά αποθετήρια διατίθενται μόνο με μηνιαία χρέωση.
- Μπορείτε επίσης να συνεισφέρετε σε υπάρχοντα προγράμματα, διορθώνοντας σφάλματα και συμμετέχοντας ενεργά σε εργαλεία ανοιχτού κώδικα.
- Το Github χρησιμοποιείται κυρίως για εκτεταμένα έργα σε ορισμένες γλώσσες προγραμματισμού. Ωστόσο, είναι επίσης δυνατή η διαχείριση απλών εγγράφων στο Github.
Εκμάθηση: Εγκατάσταση Git και Github
Προτού ξεκινήσετε με το Git και το Github, χρειάζεστε έναν λογαριασμό Github και πρέπει να εγκαταστήσετε το Git τοπικά. Δείτε πώς:
- Αρχικά δημιουργήστε ένα λογαριασμό στο Github. Αυτό είναι αρκετά απλό και μπορεί να γίνει γρήγορα και εύκολα.
- Για να χρησιμοποιήσετε παραγωγικά το Github, χρειάζεστε πλέον Git στον τοπικό σας υπολογιστή.
- Τώρα, εγκαταστήστε το Git. Επιλέξτε το πρόγραμμα εγκατάστασης που χρειάζεστε για το λειτουργικό σας σύστημα.
- Ξεκινήστε το Git Bash που μόλις εγκαταστήσατε στα Windows. Ξεκινήστε το κανονικό τερματικό στο macOS και το Linux.
- Με το 'git config --global user.name' [Name] "'θα πρέπει τώρα να ορίσετε το όνομά σας.
- Όπως και πριν, χρησιμοποιήστε το "git config - global user.email" [Mail] "'για να ρυθμίσετε τη διεύθυνση ηλεκτρονικού ταχυδρομείου σας. Χρησιμοποιήστε το ίδιο μήνυμα εδώ που καθορίσατε στο Github.
Github Tutorial: Δημιουργία αποθετηρίου
Εάν θέλετε να ξεκινήσετε με ένα έργο, μπορείτε να δημιουργήσετε ένα αποθετήριο με δύο τρόπους:
- Στο Github, κάντε κλικ στο μικρό βιβλίο δίπλα στο όνομα χρήστη σας για να δημιουργήσετε ένα νέο αποθετήριο.
- Δώστε στο έργο σας ένα όνομα εδώ. Όπως περιγράφεται παραπάνω, πρέπει να κάνετε το έργο κοινό ή να πληρώσετε ένα μηνιαίο τέλος.
- Στη συνέχεια, κάντε κλικ στο πράσινο κουμπί "Δημιουργία αποθετηρίου". Στη συνέχεια, μπορείτε να προσθέσετε το αποθετήριο τοπικά χρησιμοποιώντας τον κλώνο git όπως περιγράφεται παραπάνω.
- Δημιουργήστε ένα αποθετήριο τοπικά με git init. Στη συνέχεια, μπορείτε να συνδέσετε ένα τοπικό και ένα online repo με το 'git remote add origin //github.com/[Username[/[Projektname[.git').
- Τώρα διαθέτετε ένα αποθετήριο online στο Github, ώστε να μπορείτε να διαχειρίζεστε τα έργα σας και να τα χρησιμοποιείτε από οπουδήποτε.
Μπορείτε να διαβάσετε σχετικά με τον τρόπο χρήσης της σήμανσης για το readme στο Github στην επόμενη πρακτική συμβουλή.