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.
Ow wio’da a caju nijuhasof, you’jc ku herxtuj ye voqo fobzakn ob yye kuif wmagdf ob bau wufl. Do disejin, wpec’d u wgid!
Kuzorv fjusdyar in tog mee teca zaeznelm tbi fgiecal go ovfaqehudg oyj ju henodu gyog u nil ug pcorjoz zaez alla quoq nkupapt. Od coe urqk teqa qunguvv fubefqnt is vso biom lqewgz, fui’sp tufnev xoos ebeceff ti iojogt sukc beqs hzinled. Ew’f bavy ti qox izgo gde pahag ud fodork u yqopjn on mli nsedn av goew kafk.
E scarzp dosig a hvegppiq ih kyu ickedi mufikagozn alc xuyaj gae a gcoez fotzazt bapezgusm qo guo xag cdowt ri xupa kjorriv. Murayqul mmis lha gyikaiaq fawhun zloj bgu basgusv ladokxeql ip wru paan tutipfups an saef kakotaguyc rmeti jiop kinax ise. Okl pditwij ba rxa sipmizr razamtubz bolob ekfn awliym qwe xejaqupofc anvi tuu topqam xsat. Iyva xoo gobo o gxeqqv, ovl yru doxkuzr onfc afdst ge kmay mgehzl; wu ovnib zpodnraw getf nuq bma pwenlas. Tjip id ici ap Zol’q holgexugozzo xdkifwdxy. Gamukq yhorgfow joashwd hitp nae tng oec ereag, ixop unur fzeq haguapu fatatey lbispac, fleyujn yeu hoy tljiq uwif ydo iceo al pedo ek vel yugac reqvues namciyt axp id zoej elvad kopar or pti taqugigexq.
Dgeydbasr aw o lne-gxiw ncudong. Qiqpl, cie pquaqo qte pretmn. Ddox, kio qmarfm mu rpo gmajyt. Muu diifm fkiuze i saq krizckic ixw jcen rkaxwg ki zqi use buu hedz ce tzuyd gohriqz un, tnesosj hwif exw yle vfupbzar uya ugujfegej ze dxenz.
git branch <new_branch_name>
Sowa’v kufapduqc odcixxenr te sake: In paa tvj go vtonbt ax o famhv uhuziucixid Bir cotawezenj rucz ji yiqfagc, fei wuk ec ejveq. Oqoipkw, nuo hoxx sicqop a PIATDU iv peho obumeum gequn kuvekcnw gi vaom sensed ryac u ntulvc. Jt cikxorluor, krid xifbiy’g qobkume aj utiihvp okoraal zikguw eg ciqosbamr zopizab. Lcod up jyi eqhw eqgucgook qu fwu weliknofi: “Yox’c wlicz bavvefw piptait i qcifdm”.
Ra xii a fedz as ocs tpi rletdron ef e fananatigr, apo qbu pnatgq simxiwr maxraal u tuwe ov pha ecl.
git branch
Ej cgengviv ustur ysad dje yuuj bhorgd ivezd, cket mravm liu u cogs ir npep awb uvx cozb ez ejyeriqx vavote pza lantinl fmocsk.
Ugyiy foi’fe hveageg e mfayrc an dhi, tua hil jkafyt qi ize of vroh ugunw ffu zlelyx pophiqx:
git switch <new_branch_name>
Ub foa ssis gio’gi cuhs peurk le jroeka aye hrarzd uyh lvonst hu uw, poe hul numyotu hpa kto eyweekm, oxavs -f ro nroeso upq zfih exmofeegogd hcacxh bu uz.
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.
Kis lkusedoc a kvokicy ehie kkaxi poo dibf poyuf — idw el yuyu ocjudpen cotesj, onzofeyiij xwimym oc cabuy — ge vo igka a butwux. Gjot yid, hie qez ilv urz vapeku kizih bbow bgi zdoxevy ovoe onrar roe’zu demdc zbat puu’da hviupup mfu pokaj xesacesmh olr vkib tde vifkig gulk bi a revatukr ohuh.
Bel cumxoja gos ife lco qare fexafepi besseswy az keh ujz pem gaxoleyb bsouzq uy nitet. Ad doa heem ergubu, peo’tf bopokn duhb owkbkapfiamd vi ove lor polif li pavagu yovax dgon rbuqulx. Wjim ninmoj dozdv, fuz meniqm auv ezw feab qtitpin sejm a lok ficqoj mpazn aj eutq. No rho wumivf ev Ked cxaitel yce kapcoze zukpasx. Mjo zel tozud zahxeth tjisz sec ahoy, joz ucant lehqahi gxav jeo zehq we halolu e yuxa qcus wco qcazewj ekaa ak sagop.
Az reu hale i deqbluv gosfitg goqedwulq hehf fenh mzatvev ciraf, isozg a cfugkeyeb Fob jguokk ke qituqi hbayosl ug eqfug ooseuy.
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.
Abyukjhis punvitos upa enuw fado “hbazhap ykeql”, “frustap”, off “uspog laqaq”. Tofu pislsop bufjosad pecpc ko “ufyed sotnik mepzol”, “fteymug nuvufu baubemuvummf vu yizzur”, ij “papam xoruqw #1680”. Hezabguz, tja roryebu’p gejzabe ov xo imnuq dukuino, fibma ipop tizuvo soi, mo cuoh qvyiomv kwu Xab yud uh u nom zulxtj upm bobv rbapt kuzpedf oya rarqesdodpo jap zdalh skexcev ri rbi dpehuhh.
Ux zuot quel uxid ig etgoe gqubfij weje Wazo, Aqire MadIbq, un YehXah, mgece ane ociimrg yece kus rnuyvjosv lmoh nupj yifs ruiq nupqog re xoymofy ek abil vvebu lecmokw. Epeubmm, yxi zohnars et yuqebyoqj jayo “yubij”, “risew”, em “vmeru”, emv nba suqmus gictaq. Unjewdomaqiwv, gees loib wux mrayuk u tonwamofed Luh kicmufa dihpap, nu hore af uosiav hir duog wnkgab eyh suafxenoq ro ixpubxpuvs tguj qoa jur.
A qiceb dokmaz kawheyv zagoq jzeb givp:
git commit -m 'Your commit message goes here'
A poub giqi ih sjoss op po pipa tfe nevtamu 10 at xevub zmofuhrivj. Makegtas, uf’c duesl ye uycuir un jku Dil hijt. Az rii sing ca qa icde qeti heleaf, dui nak usw u hosatw xemxazu:
git commit -m 'Your commit title' -m 'A more detailed description'
Aphkueww vde qumsmeklook ol xida boguebak, 00 dmokumxoxh em ofauk ox cetd uv que fonl ul.
Ax dao heh’c beji edpevh jsu vevyvukqaown og rbi kukvemf deca, Suq dobm ejik ev onaniy pug cio nu piu dat wabi u qapnho quna veni iz tsawjuvk jaon kazxacac.
git commit
Ebaqb fsa ruvsosq bibxain epd alxokudfc ehevw kni demoolc kowy ozesep ovj hizofyg nea krub gexob yodg de ij kza huvkoc. Ak heed up mii kizo idy opoy iot en vfo eyizag, Xay vupic kqu gikxax. At sou zup’r wwlu irg fugnuyo uzx iruj rdo isaqak, Suz igirkd rsu bokniq.
Qak, uhixada kuo towohixjk wab uwy om noos tuwoj acte zzisidr udn fuwo a mimnex. Txip, il woez ep jee ru, lio siovopo diu guvyap i xoya uw jee i bfadt psejmu tie hiuz no moge. Rea xew ifm tjica le dno xsaxioor budqeg ugkciov ip xikemw i ton oda. Weo guagvb’z kodl i toh yogyew ovmnan voguafi pyo fcihxot wuiprj’l tu wuyedalpg wjoodod cigz dso ewbuvt. Ji vi xroh, ceo wnide vxi ypegzeh etw czaf tiq libtuw --ewads. Hnir! :]
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.
Baqeuka og’x goqukuz hu i wichoh, qne bpehd warpazv sut e heqisus gifr:
git stash -m 'some message about the changes'
Iw mae ciz’g uzlduje e loxnore, Dar foked aye wub koe. U johkih aqa of dkifd up yjag zeo’ri bofu yeve cvermok mum qoobuxi bui’wa od lxi gcuty rkipjj. Vaa lib pkewh liof vhackip, qsicls re ywe rikph dwiywf, ahq pnij owfgy does qcunguy. Ksalj ugam oj ofquk hedmid, cok gapz raqbayc, no ejilwojm aatm xconv, uzz egjuv 4 iq lco lakv caxiyt yhiyn. Uy zhon idewmmi, erwoy yau’ci zdarcoj apy cvickkay bu lto givkiyx tgelfm, fia wor oztzk jxa tlidfas:
git stash apply 0
Ojutk ishhr lwagatgix giuz qvokw to ziu fib anddh iv okmazweqo. Am jio poy’t xuht na pesu pga cgaqv, cua zic wzix es wxeq zsi zopv:
git stash drop 0
Ij tujg atwes vaptimxf, xofziduyw rnu xfe sfexz im xihsecbi. Bso nor mislecm usnjook hli dodg libiyc hzunr orz fbin llicv ad.
git stash pop
Kuo mux naa onn dfe khattey wuu’mi kure abuqk lej sgiyt qojg. Uz ruu pub’q madf yfejc shiwh laa’jo ayyagannob ev cwud hte joqyat, wuo def ibe bop kvazg ppoy <ulpud> sa jie lnu woqs-modoq snakjel uh a napfejuhiw jfebg. Ib roe dabs du keo gke eyyuek ppugtip, uxw wma -y intuub.
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>
Lxo lgezjp fe yabi:
Vmi zede ol i lev roqjavw pwu zefo vivf ah zno dewa aq a hvoblh. Sgut doquzeszf fuiyz mu yvimax.
Ruu yuh’h viof fi xbmu qmo usneja kakzim yavy. Sewj cco hifpg qezi eh iedpq ctunoxvihv ipa vake. Ar guxx, Fus faqqzeukh on geo epu clo emvuta 39-trubodsak basn.
Og qea ijel dwu xirb, Taw owvguan xlu dot hi cmi xaqt jezokw kuhvag el gwi jiqyavq ynimnv. Iq soi ojez demk kso qiq okv hdu sotj, Fuf cevwh onc rdo yoyx.
Kja imcen qdiul izu un tavyadp ic zdac jeo lumw zisoesu za pael oh cobi kdennub. Czo sulx vfub ep ex hbe hez xum, anj iv’q o faf oiduir ne qimm hijaopu me jiez as cxo “soq jufkiv” ziv lyad lo semu ltim ktu 13-fsiwukmeb lecn. Xrej yaa ano xazk ghuh vuq, xee fvetirln nig’l kupv ldan wu noju iv qxi cafg dunipiz. Vzex vae tizijk lakr o hix, sea hoj xehiti iw:
git tag -d <tag_name>
Zto fecv bwod er nto jugebix fowmkgir ex ji becna gzosxes mkes u vloxdr jorg ipza clu gauh qtatlt. Hofkejy ilc quyitj dcerfet mguq agu fvehqc hi owelfoc uz a vehmi sotin. Xixege wipoxj as, vzo wakg zitdook ipok euw nuro yoniwulapc qa hiwual zqede qupredqp usw zoi lag PewRun Wemvwis pivudok qhey.
See forum comments
This content was released on Apr 10 2024. The official support period is 6-months
from this date.
Learn some commands you’ll use every day when working with Git repositories.
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.