Github apmācība: jums jāzina šie pamati
Šajā apmācībā mēs jūs iepazīstināsim ar Github. Github ir platforma, kurā varat pārvaldīt, uzglabāt un sekot Git projektiem un lietotājiem.
Github apmācība: kas ir git?
Lai saprastu, kas ir Github, vispirms ir jāsaprot Git jēdziens:
- Git ir versiju pārvaldības programmatūra projektiem. Jūs to varat izmantot, lai vienkārši atgrieztos vecās stendos vai strādātu pie projekta ar vairākiem cilvēkiem.
- Varat izmantot Git operētājsistēmas komandrindā vai Github Desktop - Git klientu ar grafisko lietotāja interfeisu. Lietojot Git, jums jāzina šādas komandas:
- git clone [URL]: klonējiet Git krātuvi no URL uz jūsu vietējo datoru.
- git init: inicializējiet Git projektu lokāli. Varat to vēlāk ielādēt Github vai citā resursdatorā.
- git add: pievienojiet failus skatīšanās sarakstam. Šis solis ir obligāts, lai pēc tam augšupielādētu darbu krātuvē.
- git įsipareig: uzņemties izmaiņas. Šī ir kabīne, uz kuru jebkurā laikā varat atgriezties. Aplieciniet failus, pirms tos var nosūtīt uz attālo krātuvi.
- git push: Ar spiedienu jūs visas saistības nosūtāt uz attālo krātuvi Github vai izvēlētā cita pakalpojumu sniedzēja serveros.
Pamācība: kas ir github?
Github ir jūsu Git projektu mitinātājs, un tam ir līdzīgi rekvizīti kā sociālajam tīklam.
- Ar Git jūs varat piekļūt projektiem, kas saglabāti Github, no jebkuras vietas.
- Github glabātās krātuves vienmēr ir publiskas. Tātad citi lietotāji var apskatīt jūsu projektus. Privātās krātuves ir pieejamas tikai par mēneša maksu.
- Varat arī dot ieguldījumu esošajās programmās, labojot kļūdas un aktīvi piedaloties atvērtā pirmkoda rīkos.
- Github lielākoties tiek izmantots plašiem projektiem noteiktās programmēšanas valodās. Tomēr Github ir iespējams pārvaldīt arī vienkāršus dokumentus.
Apmācība: Git un Github iestatīšana
Lai sāktu darbu ar Git un Github, nepieciešams Github konts un Git jāinstalē lokāli. Lūk, kā:
- Vispirms izveidojiet kontu vietnē Github. Tas ir diezgan vienkārši, un to var izdarīt ātri un viegli.
- Lai produktīvi izmantotu Github, jums vietējā datorā tagad ir nepieciešama Git.
- Tagad instalējiet Git. Izvēlieties operētājsistēmai nepieciešamo instalēšanas programmu.
- Sāciet Git Bash, kuru tikko instalējāt operētājsistēmā Windows. Sāciet parasto termināli MacOS un Linux.
- Ar 'git config - global user.name "[Name]"' 'jums tagad jādefinē savs vārds.
- Tāpat kā iepriekš, lai iestatītu savu e-pasta adresi, izmantojiet 'git config - global user.email "[Mail]". Šeit izmantojiet to pašu pastu, kuru norādījāt vietnē Github.
Github apmācība: repozitorija iestatīšana
Ja vēlaties sākt ar projektu, repozitoriju var izveidot divos veidos:
- Githubā noklikšķiniet uz mazās grāmatas blakus savam lietotājvārdam, lai izveidotu jaunu repozitoriju.
- Piešķiriet savam projektam vārdu šeit. Kā aprakstīts iepriekš, jums jāpublisko projekts vai jāmaksā ikmēneša maksa.
- Pēc tam noklikšķiniet uz zaļās pogas "Izveidot repozitoriju". Pēc tam repozitoriju var pievienot lokāli, izmantojot git klonu, kā aprakstīts iepriekš.
- Izveidojiet repozitoriju lokāli, izmantojot git init. Pēc tam vietni un tiešsaistes repo var saistīt ar “git remote add origin //github.com/[Lietotājvārds[/[Projekta nosaukumsx4.git”).
- Jums tagad ir tiešsaistes krātuve vietnē Github, lai jūs varētu pārvaldīt savus projektus un izmantot tos no jebkuras vietas.
Nākamajā praktiskajā padomā par to, kā izmantot atzīmi savam lasījumam, varat lasīt Github.