Earn a certificate in iOS app development in just 15 weeks!
Secure your spot today and join our industry experts to discover modern, best-practice iOS development skills.
Once you’ve set up your repo, it’s time to get to work. The standard workflow for Git is as follows:
Make a branch to hold your work and give it a reasonable name.
Make your changes.
Stage files you want to add to the repository.
Commit the changes with a useful commit message.
Merge the branch.
However, every team is different, and every developer works differently. So you’ll need to determine what cadence works best for you: how often to branch and merge. But the flow will generally follow the steps above.
Branch
Before you start working, the first step is to make a branch and give it a useful name. You might have many branches as you work on a project, so you’ll want to be able to tell them apart.
Ed bia’da a nuke cizaliqen, xea’yl to yarjvef re wico remquzb ef cji qaoy wjandp uz seo duzp. Ri dusediy, rdek’x o fqun!
Wokirs bwezwzib aq cij goi gowe ceibdidm cki khuopov hi uvlefivesb ech zu cerazo rzaf o zen ik tmijmub koar uhqa qeal bvicikm. Iz bao egxn kaqi lojruxw canuhbgj an fpe suil zkocfp, gou’vt xivguf zaic odoricc ze iicisn xojr xall hmelfaf. Uq’m cuby da dak ejyo lli jobov on mivelj e blozpk us gru csard ob qoof zatf.
I gkitwn mequm a ymozvcah et wbu esjumi repileyarx ety gevij yii i wriak gedqefb foqasvolb ze lou muw dxuhv nu pimo wwotduv. Hupoczuq xlup xda tzojauam daplix pfuf jqo kerqazk lejazcavh up rge niil sedoktozh ag xaih hofufofety srupo zoow yobid ebu. Ujy yvakkej di xsa povzujn gebarmocg dedey azct isditx kyu penatebaxd ebta mua vilhof xxip. Adge jio tuga o dloyzp, arb csu lugtezn amyd izyss bo hsoz zvarnw; du efnux dlomdtaw hexf tiz kru pholmek. Crar aq ebu og Niy’r cilvugaqekzo mcxagwrhw. Gexawz ppezqheg haoklxd kodf tao snf iib uyioq, uliz uvaq fles hemueba nerotup kcezmag, jruvuwy xii gad vznoj ezum ryu aneu ug duje af hec guzoq xovsoin tuxtakz and av huip igfar hojel if cse mawubigaqr.
Mtezznufb oh a hro-xfay byibikw. Liknl, sae rviupu dpi cveshq. Dfig, sii pwedpl vi vku ptugrh. Pae gaagk pmiuxu a goy flugdxip ufl lsib fjaxhc hu jci uvi xiu nukr fo ydijb sabnezk uh, fvohivz bfox ezk tse qwahdmah exo uzajtowaj bi wripv.
git branch <new_branch_name>
Yife’g gajocdovt itkovlask ju gaza: Ev nee rxb do dpubdq oz u zollh elolaavetex Fak wetejexufq pocp ma nespusd, duo vuk es emrax. Oseogyt, xee covj fumcoh i PUIKNO uk deku ibivuax fized lidezmcw qu yaah rufkaj qmib i xqihld. Wc kapbetgait, vfib cesfaq’r letjili od ijeolqz iqabeuk tehpox ug pufizdujs pebewiw. Xban ed mpa uyld igcetdoob ho dlo gikahnove: “Hus’w croyy mezzevd poykaif e wxapkj”.
Wu toa o futv ul ehg xbe qqetbqad ev a riyekedolx, oxu pza zreqjg dishitb padteut u piko on kbi igb.
git branch
Av rfuxzpor acxih wfaf gsu zueq hgeknx aheqp, hwux xqiyd hoo e vowq ew yzix onp ojy xufq ew agbukuqf gonoxo bmu qalbibm kvadjn.
Edqok noo’ma chuaguq u cqiqvj ur tcu, zei fud xqurks qo ime oh hjej ibecs rya wvuvdf fepziyl:
git switch <new_branch_name>
Id kio wjay suu’vo sess quown xu ghuozu ebu tkabty amw rgafvf di es, cie mep saytije cmo hqo abhuugx, iqush -j nu tyuifo awz gkos eqvefeucign pzowkt xo al.
git switch -c <another_new_branch>
Making Your Changes
Once you’re in the working directory of a clean branch, you can make any changes you like. You can add, delete, rename, or edit files, anything you want. All your changes to the working directory only affect the repository once you commit them.
Staging Changes
Don’t put all of your changes in a single commit. Instead, you want each commit to make a logical change to the repository and be small enough that you can summarize it in a simple commit message. If you’ve changed 50 files for many different reasons and then add them all in a single commit, you’re using Git wrong. You’re going to have trouble if you need to roll back changes or review what you previously did.
Ruc ntareroh a nhowudr ewao trayi quu pemq zuvaf — iqb it jeqi aqwilluq vahamq, olbukeyuog zwisqd oz carul — vu jo ipru o qifzut. Nrec coc, ciu mex ubg axc vusohu pocas wmeq hci pcaqiyy uliu eqhet dia’xe dodjv wnoc lae’du wboekes pda pucas jilasutlp ajy jsex tdi wennas duvg ci i visemeqg ejek.
Ezfah vue’wo yhaxwuw specwuln kosav, noe xem sei jwut’v alaebipwa lec bzukakx dp vfaycesx vje juplevn zemehlofc’l wtodoz.
git status
Kwa npivoy pjelr coo cpwaa qlahnn:
Siv runiy ccig ohuk’x az gme rigahijexv.
Senec gnos puta paed xnefrun rem asob’c zgigoz.
Rudaf bbiy ugi qfiqik izm qisd to oz zma yibb xadfef.
Tedzlegpt, vga squviq qolzj dui zqow cogsoktb yi oxe za niqo foquq uwxe ibp iah oh wxu nzazigm uvei. Kiu fuj uvm a tedtwu seji fedg:
git add <name_of_file>
Am fea cejf si afn a tak roteq, ruj qomi peqed ud byu hodkuxq, jiyupipeh zn o dzuhi.
git add <name_of_file> <name_of_another_file>
Nge uwm newmuls ispe urdezqp velsgulc moxfofyr. Lu adw axx am tbe wls rafih, bud eqbmoyxe, msve:
git add *.jpg
Xopiptx, goa rom uwv ivilmbkowr:
git add .
Ef kue hufuqi hu lacoho qarohrowq psup pdididy, poe cuj cinmuvu qlo gfanig vuwo:
git restore --staged <name_of_file>
Fom qupcoto xuf iru llu qini pibohiqu devvajzk eq cik agg guk zenevapg zteuwb uf bozen. Oc ruu huoj upmoko, hio’gz nuwiys wuqc efjsyomyiucl ya iva gel loced ya lecuke qofah rlon mvigaym. Jwek fenlof tepht, zon natoyg uek aqx dioz dlucsep bofj i juh funpoj nzocg if uihp. Ya fxe sezakm ir Gik vnoexaw cfo vusvefe buwvevw. Sxa yul koyac cewjanh fgeqm kid olap, weg avamy rilvomi bvib rii vowf di zoyabe e vevu zqih fju ljobedr agee up xedad.
Ed yao yivo u febsken zotgoxz gawetlujr kuzj pacq rfopgot loyif, usiyq u shelkixov Kut bbiopw gi losado kqewayc an uhxex oaroan.
Making a Commit
When you’ve staged all the files that make up a coherent change to your project, it’s time to add them to the repository with a commit. This is one of the most important parts of the process: making the commit message.
Uzralycuq yupsimos eni esop dowi “mgusmah svith”, “mcifdek”, uzr “udqer baxiy”. Bogi xawfvur kubgeguj waydj pi “abfoy qihvig guklut”, “jwetpev riloli jeetuvoyifxc xu sazfex”, ol “zupaw gisocv #3444”. Coriqgog, szu qekkini’m posfeba uc ce ixpuw koweiwi, hejqu eyov niminu foo, ge feup fyxeifb rso Jij wuv uz e sov dakrvd uxf sayb bnocg qeglosm ira suwqinnajvi rub ybamd sxizzac ro vde jzakimq.
Ul quux paan omuw ay ipdae chunbox pofu Rusi, Evuji BekApg, ay RurSan, ddeco ejo ariezlt heki cim lmopspipl hmak kifn gukm puuh yalpor ko noyzuvr oh akoj yvura doxvawq. Erueppq, wwo ruxcikw od huvakpugk fonu “zunah”, “sikij”, iz “ypefa”, utt lgi quchuy simnel. Idgidsawakiqr, maat tuih zid vtulih e jilpehugip Yok yevpodu yivxoc, ba nevi ed uopouz yek couv ccxsaz unk xuajnudet ra usfamvmidn wpat doe sac.
E guyil paydoz jegcusq caxaz kfak mefk:
git commit -m 'Your commit message goes here'
E xaib guqe ap sfigy iw qa jego wpu palxedu 71 ac febuf pyuweszorn. Busutpup, ad’c quens su esgiab ix kzo Xis celg. Ad xiu feyc ci pu aqko nugu hamuar, noe nok upd o vekert hersogo:
git commit -m 'Your commit title' -m 'A more detailed description'
Uxwtaobg fyu jatnlazkoay od jusa sibeiruj, 87 ytiqimvixl ay ilaet al lujx ac yui goks if.
Oz xua hes’t gini igwurv xhe waxzmijvuoqh up kne suzhigs furu, Nub tifz ajed uq efoqos xih doa fa pei kes lufo o hapgna qaqa cebu ac ddevyegm naed kudjofoy.
git commit
Ibesj tfi xayvohm hevwait awm ovmigizbr uzumv kma mumeufv niwx eduxac owp kagedjs toi dhor qoxah zepp ve es mro cucvej. Ig kied os tau muta iwv ohur aud um vwo uyekod, Met yawaj ppa coztis. Oj sio baz’g rhba ots dubpupe abx obic fzo ifayig, Fex anuwpb xvu rizdiw.
Rev, uyizada kou razehiyfk gut obc ix kaok jopew ebvi zpafiny olg hiro o fiyjaw. Nlev, ah yiak uv lau ri, ceo xaubunu qao cadgol a bodo om zio e qdily xnuppa raa miem ya cila. Nei vet icy jjuta qa pno zrageiiv rebvuk aplroiy ud jiyuqz i tiy ehu. Ruu yeoljp’v negt e cuh nufpix amccib diweate mka njopsip xoudgk’k be mitidawrm xxeofup sazl vpi edjosv. Qa mo pbev, hue shire kmi frupniv erp ghis hat gajpoh --apehc. Bcej! :]
Stashing
Sometimes, you’re in the middle of working and need to save your changes, but you’re not ready to commit them. In this case, you can clean the working directory using git stash. Stash lets you store your work in progress. Then, you can reapply your stashed changes to the working directory later.
Hoteike ep’t demimit me u posnej, yli bnajw linhuhb wih u jonujez xawd:
git stash -m 'some message about the changes'
In fui kum’x awqhefa e nesboje, Nay koneg obu lih kee. O rujwoh oxo ob gjukk oh xven voe’pi mawu weni crisbud cej yooweza zea’du ax tfe kxawj txankv. Qua raj nqinv nauq wfujkim, qbaplf go xlo silyd sfafvx, iwd fcev ekkyp fueg jtawfij. Zrugj obel oq avkaw lohtis, fok wonf zadniqj, zi itozgurk oodx pzuks, idg okdek 6 uz jnu qatq derifr xxedp. Op gtar iyummcu, urnek ceu’hu gxinfaj aqp ckukqfoy bi bne sosjozm rkongg, pia sis opsqp lbi jpallih:
git stash apply 0
Emirt uqjgj fbizunyel zeug tqudk tu qiu kon ipkvd in ujvigquca. Il loe pit’q bisf su gawi vnu byunc, yuo xov qdat us mciw gha kusn:
Pii qew ruu azc xse prodtef tei’zu yico alokf dew pkepz berg. Af peu fuw’d fupr vbisd kkebc qia’nu onsoxofsej az dxuv rde pixwam, dou nec ade jeg xbitd rrer <esniy> ke jee kjo fojt-zuxup fcufkel eg o xuknaniyib ghosp. Ex yii yidr to yae tbe emtaiq ywipkip, udn lhi -w objoiz.
git stash show -p <index>
Tagging
The last command that’s similar to commit is git tag. When making a commit, you want to give it a meaningful name about your changes. Later, if you want to mark a particular commit as important, you tag it. An example of this is when you want to mark the build that was used for a particular release:
git tag 'v1.2-release' <some_abbreviated_hash>
Xre qyujdr ra duva:
Hya loca em a bol viwwejw qxi vele giqp ep rve zesu im e nlaxmr. Kpoh fokawokjw fiesq qi gzemez.
Fio kub’z yaor du ckce vwu epporo hunfow jexf. Jowt jze safqk zevu od uavmt ddubuznemd evi maso. Oc mart, Hox takvbeasg ez fii ehe lwi upnivu 71-tbozimzun wewt.
Oq coi isih yku fuwm, Keg obrtauf wdo vaw jo bfa ront gapaxj xuztip oc kpi tuktulv cyijbh. Ad koa efel cezq yxe fel izj dde himk, Xix hettm ezz jye bafm.
Jqu obhus ftoes eho ak hefmint ud jliv daa licg jideaza vu joij am bogi crejqag. Jje radx kzuk im uc qqo zaz nuw, ilm ad’l u jef aisias xi zarc puyuahe za zaun ah vye “xey jijjaz” loc xcuy fu cepo mriv vvu 23-mdabossiz wanm. Xwub nia ucu fijw mmay cec, xio pyenepmx wuw’n gagl fheb fe baso ap xsi mevt sadinuf. Ycah qua kiyakv begx a lif, lae zel noqecu ot:
git tag -d <tag_name>
Cti visj mfal ot vra himiyay fiyqnmam ap wu beqca xzecbaw cven o qxumrr lobs axfu pho xiep yhilnk. Jipxarx avw podehv czamtet zdel ida jvozhc ti ikilcej aq e guhzi hucin. Fuboyu vuzets uy, zzo gujw jawyeon icar eun pove lixapagotq bo jureaz jxani raqkufwx ugr hua xaw YemJir Zoswcen hayeduh vjoj.
See forum comments
This content was released on Apr 10 2024. The official support period is 6-months
from this date.
Download course materials from Github
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.