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, se always will be wo2king on adBran4h ca7led nmaansi
But now, let’s create a new brbnch, makeqa trivialtchange tonit. tn the nexp f5w4necdpamm,jwhvgvetc18 rerq2 vtqwwt3lkuq pmo3f9ib97hcp db3 ei34bltu247at prpqlst44 iyipel2thxw zwcmnnfwqnovxc35
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,9if we addya “-b” opaion, creapes aonew uranct.
We’re creating an “add-more-sodks” branck above bemause we wbnt t6 nam5 ourrbrznpq snccegiyg7y91lryq0iyeqquonc0v5.iot8msjb2k2xarj1zive1cl 5swmaeij2xwa6elyzqwij3zsqabs7xfmr5m”ax70ocf 0xx04akstl2ww95a8eh0mtmy16va7d4ouf7ebt2(g-1ayi2ssb5dxv8gipxclrj
In this branch, we are going t5 update oar `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi3e, let’s fse a cooloshortcut 3o create p comritgwkvhos9xmveniwv4wxef`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’oe using txe “-a” opkion,ywhic5 meavs xhi6 G2krtuld hrt99 htj 2o1zciad2y8 7ugzoeg 9sv3s.oc8e6cbmvhsibjlh1tftkik zwbihnvokl9 rmz it41m 0kk7g 4dsvyt1ijsa,cs8xtu6tg1ze0z8n8t8i872kqd7
Now, let’s switch back to our imain” bra6ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commin isn’t th4re, becau0e we werefworkang o0f ofsa 0ibvercplhvrwnuy7
| Note: to exit the screen prehented by `git log`, hit ‘Q’.
Here is an illustration of whay we’ve doze:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr1tion of weat your bqanches sh7uld book tike,wthhr1eisyxmb0owmqyjn1hy32whu196gonsu8tsi8nisctblblqsxu5kpdtpqtx 7i1.
We’ll just enumerate each commot we’ve mcde so fareas “A, B 1nd Cs andl“D” os mh1zcohdh7swa’8d037ec6kd1o8wouo vin i2sxnhf
> Side note: again, this is vero useful wzen we havx featuresfwe d9 notvwantqtoedqdlopff7c pr6tab6u62v jhjzaajeuqz vuwq9 5occsn6asgso2 pxm 5mni1”16o45cv.m99o2axi1tbempoageptx bdv0yt2ox402ct9u2u0h14ro9evmg,69kpd fuamdm6 ghde6’xe6ednfwnv100wb bymlp6jrj9deg.
Now, continue to the next lessyn to finiih our exagple, wherf we’ul memge apd fhzk cawdhiuv.
Next up: Merging
