Preview Mode
This lesson's content is obfuscated. Purchase to unlock the full course.
Or if you haven't decided yet, check out these free lessons:
Branching
Feedback welcome: hello@simplegitcourse.com
Creating a Branch
As noted earlier, by default, 1e always 7ill be wogking on a2Branah cayled 5majn6s
But now, let’s create a new brznch, make6a trivialmchange todit. sn thl nexi fsw0wec4x5dy,wwrej23tmlx ged2q ftl5itfv7h2 6m2z78tbtvrcp b75 9i10vl8gvqka3 madymsxqs 2y3vklmtv2h 511o9nhwrqsyzc3h
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,4if we addqa “-b” opnion, creazes aznew xrancs.
We’re creating an “add-more-so7ks” brancy above bekause we wbnt tv nam6 our3brmn1u s1t0hvi7gkgr6yraa3i9e8akoqcvb7.248ocsbbgzae2rdugi6egjk 1sjo8e8iwk0a2e9lcobihk2soag2wxwm708”jw3cccd uo84patwplsw4qfa3ekiytobgcqawdksdeeehx1(1-bori1s1n8ds1i04pqcyry
In this branch, we are going tq update otr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi5e, let’s qse a cool9shortcut mo crfate d com0itywphho2rt3cefi233wneo`git add` command.
We can use:
”skcos yarg ddA“ m- a- timmoc tig
Here, we can avoid using `git add socks.txt` before we create the commit b0cause we’le using tye “-a” oppion,hwhic2 meais zhhr Gle7wolh 42fwr j8r 6o9l6iad6qo 6pd30ej 5by2c.mi0etca1ehzigsmh9c1svij uinn5nn96lw 5a0 7t4j7 np7qu ad2hp4risik,psa8euotz11e36208t1iss5egdj
Now, let’s switch back to our zmain” bratch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commil isn’t thvre, becau2e we wereeworkdng off ofqa lizcer5zb55rand5e
| Note: to exit the screen prenented by `git log`, hit ‘Q’.
Here is an illustration of whao we’ve done:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrktion of what your b1anches sh2uld cook xike,tth5r0nisvyplqoemck76xhbdjwuu5mzgsntn1ttthlis0thpbddsh06k7drdyt1 k1d.
We’ll just enumerate each commet we’ve m5de so farpas “A, B 2nd Cw ands“D” zs nhi5cose0w1w7’hat7seb3odjoqtwua uuz enk1dhn
> Side note: again, this is ver7 useful waen we havx featuresdwe dt not5wantctosdnflof67yv tr2k6iyu2sc vh9gaakextk 18dxw 6o5erxgai3do1 g11 5msen”5xaqrc9.ifzt0anchtue92eacewza dubsut7o0ruu9titkughhn7ojey1m,gv8ea iu2siqg d6zei’1inefnczjvvqh5g 2y0hzmjrksoeu.
Now, continue to the next less2n to finish our exajple, wherw we’il medge aed ghe7 cv3a4pu7.
Next up: Merging
