Ukuqala iphrojekthi ngeGit neGoogle Code (Ingxenye III)

Futhi manje, ingxenye ebabazekayo yalesi sifundo esincane.

4. Sakha iphrojekthi yethu

Sakha umkhombandlela oqukethe wonke amafayela ahlobene nephrojekthi. Isibonelo, ngaphakathi kwe- IKHAYA yomsebenzisi wethu sakha ifolda Sawubona Mhlaba.

~ $ mkdir SawubonaWorld

Sifaka ifolda esanda kudalwa sisebenzisa umyalo cd.

~ $ cd SawubonaWorld /

Sakha ifayela lohlelo lwethu «Sawubona Mhlaba«. Singasebenzisa isihleli sombhalo esithanda kakhulu. Manje ukwenza izinto zibe lula nje esizokwenza kuzokwenza umyalo olandelayo:

~ / HelloWorld $ echo "phrinta (\" Sawubona Mhlaba \ ")"> helloworld.py

Ngale ndlela imane idale ifayili helloenline.py ngaphakathi kwifolda Sawubona Mhlaba ngomyalo ozophrinta ukubingelela.

Singavivinya uhlelo lwethu olusha sha ngalo myalo olandelayo:

~ / HelloWorld $ python Helloworld.py Sawubona Umhlaba ~ / HelloWorld $

Ngakho-ke sidale uhlobo lwethu lokuqala lohlelo. Manje kuyindaba yokuqala I-Git ukuze uhlole ukukhishwa kwethu kwesikhathi esizayo.

5. Siqala iGit

Ukuqala ukusebenzisa I-Git singalungisa ezinye izinketho ezijwayelekile, encwadini ku isigaba 1.5 ezinye zalezi zinketho zinemininingwane. Kulokhu ngifuna ukukukhombisa ukuthi ungazilungiselela kanjani kuphela izinketho zekhosombe lasendaweni.

~ / HelloWorld $ git config --local user.name lecovi ~ / HelloWorld $ git config --local user.email colomboleandro@bitson.com.ar ~ / HelloWorld $ git config --local core.editor vim

Ngalezi zinketho ngichaza ukuthi igama lami lomsebenzisi lale phrojekthi ngu «lecovi«, Ukuthi i-imeyili yami yale phrojekthi ithi«colomboleandro@bitson.com.ar»Futhi ukuthi isihleli esizenzakalelayo ngifuna ukusisebenzisa lapho ngigijima yenza yiyona vim.

Ukuze ube I-Git ohlelweni lwethu kufanele sifakwe iphakethe le-git.

Inzuzo yokusebenzisa I-Git ukuthi isebenza endaweni yomkhombandlela womsebenzi wephrojekthi yethu. Kungakho kufanele siyiqale enkombeni yephrojekthi ngomyalo Init.

~ / HelloWorld $ git init Iqalise indawo yokugcina engenalutho yeGit ku /home/leo/HolaWorld/.git/ ~ / HelloWorld $

Manje sizokwakha ifayili .ukulele uzothini I-Git ukuthi yimaphi amafayela nezikhombisi akudingeki uwalandele. Ngeminye imininingwane ungaxhumana ne- incwadi. Kulokhu sizokutshela ukuthi unganaki ifayili elifanayo .ukulele nawo wonke amafayela agcina ngo- .pyc.

~ / HelloWorld $ echo .gitignore >> .gitignore ~ ​​/ HelloWorld $ echo * .pyc >> .gitignore

6. Ukungeza amafayela

Manje kufanele sengeze amafayela (kulokhu sinefayela elilodwa kuphela helloenline.py, kepha ngicabanga ukuthi uthola umbono, akunjalo?). Usebenzisa umyalo engeza sizoyitshela ukuthi ingeze konke okuqukethwe kwesiqondisi (ngaphandle kwalokhu esikubhalile kufayela .ukulele).

~ / HelloWorld $ git engeza.
Kubalulekile ukuqaphela ukuthi lapha sisebenzise. (period) ukuyitshela ukuthi ingeze konke okuqukethwe, besingenza uhlu oluhlukaniswe isikhala lwamafayela nezinkomba esifuna ukuzengeza. Noma yenza umyalo ngokulandelana git engeza.

7. Ukwakha inguqulo yethu

Uma sesikulungisile I-Git futhi ngangeza wonke amafayela ebesifuna ukulawulwa uhlelo lwethu lokulawula inguqulo kufanele senze okudumile yenza.

Ngalo myalelo sizobe sisungula iphuzu emlandweni wethu wokuthuthuka. Ngecala lokuqala kujwayelekile ukwenza ifayili le- yenza nencazelo «Isibopho sokuqala«. Imvamisa ngishiya umbuso kuhleliwe futhi ngivele ngisebenzise umyalo yenza ngenketho -a.

~ / HelloWorld $ git commit -a

Lokhu kuzovula umhleli esiwubeke ngokwakhona, kimi vim, futhi singabhala imininingwane ye yenza. Kulokhu, ngizobhala okungenhla. Lapho sesigcine ifayili ngesihleli, I-Git izonakekela ukwenza i yenza.

vim-kokuqala-ukuzibophezela

8. Ukungeza inqolobane ekude

Manje yisikhathi sokutshela yethu I-Git local enendawo yokugcina ekude. Ngo- incwadi Sichaze inqubo yokwakha indawo yokugcina ku- GitHub. Kulesi sigaba sizosebenzisa lokho esikushiye kusalindwe kusigaba 3 seposi langaphambilini.

Ukwengeza indawo ekude kufanele sisebenzise umyalo git engeza okukude lapho igama noma i-alias idluliselwa endaweni yokugcina kanye ne-URL yayo njengengxabano. Kulokhu sizosebenzisa eyodwa evela kuphrojekthi owakha kuyo I-Google Code.

Yebo ungazenzela amaphrojekthi wakho futhi uwasebenzise ngendlela efanayo.
~ / HelloWorld $ git kude engeza i-gc https://code.google.com/p/lecovi-hello-world/

Manje ekugcineni ukulayisha okugciniwe kwethu kwasendaweni kokude senza umyalo Phusha.

~ / HelloWorld $ git Push gc master

Njengasesigabeni 3 sasilenzile ifayela .netrc izosebenzisa amapharamitha agcinwe kulelo fayela ukuxhuma kuseva. Igatsha lizovuka master endaweni yokugcina esiyigcina njenge- gc.

i-goolge-code-initial-commit

Ekhasini lephrojekthi yethu I-Google Code, singabona esigabeni Umthombo esigabeni Dlulisa amehlo okuqukethwe kwephrojekthi yethu.

Maduze…

Kuze kube manje sesiqedile okokufundisa kokuthi ungaqala kanjani iphrojekthi nge I-Git y I-Google Code.

Esitolimeni esilandelayo nesokugcina salesi sifundo esincane sizobuyekeza ukuthi singazenza kanjani izinguquko kuphrojekthi yethu nokuthi ziyabonakala ohlelweni lwethu lokulawula inguqulo.

Ukubingelela!


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-4, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   umabhebhana kusho

    kungani ungeza ifayela le-.gitignore ku .gitignore?

    Akunangqondo: P, lelo fayela kufanele futhi lingene endaweni yokugcina izinto.

    Ukubingelela!

    1.    lecovi kusho

      Uqinisile, akunangqondo ukukwenza. Bekuyisibonelo nje sokubona ukuthi sisebenza kanjani futhi sibe yisibonelo. Ukuthi bengingakafaki amafayela amaningi futhi bengingafuni ukuwenza nzima kakhulu!

      Siyabonga ngokucaciswa kwakho.
      Hug!

  2.   masisebenzise i-linux kusho

    Uchungechunge oluhle kakhulu! Ngiyakuhalalisela!
    Hug! UPaul.

    1.    lecovi kusho

      Pablo Omkhulu, kuyintokozo enkulu ukubamba iqhaza!