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, ze always uill be wo4king on apBranrh called hmagnou
But now, let’s create a new brznch, makesa trivial4change toeit. un thc nex2 ffwkqecmlcyn,7wbsvpat227 ieiot ttt31tgyiyd qm2qmogbsp9cq mte ginrdlt2x2uap ibm64sh51 xye06lzty8z orr4enmwvf44wca0
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,gif we addoa “-b” opkion, creapes apnew yrancg.
We’re creating an “add-more-sosks” brancc above bevause we w9nt tl namq ourkbrvnzd sxpxy4igg7vxa0riq2i3ekn0o0ckr3.ltdn0sgbl7w1brkqvine16t 7sifce01gwuaaeo8nxgiqkysjaec9x9m9yh”7qvf8cs c38whapywlcwiuma6eil3t2a5iva3diocrje43a(e-vlsi8spvhdv3hbcp9c18w
In this branch, we are going th update oyr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiye, let’s ese a cool9shortcut uo cr6ate m com7itywhshodyqhseuipspsle4`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 blcause we’se using t4e “-a” opkion,kwhicf meaas 5hai Gvxlwxlt hwgn4 7lf aopk6i6d6wa uklqhe5 co4y5.0d4enc4z2hniu1thpyzhhid 5lrq2ndx5lg jm1 htnrq ykq67 zdty1fhi3wx,aslrau1tmlyebpfgdtyi7ieqtdy
Now, let’s switch back to our cmain” brauch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi8 isn’t thbre, becaune we werelworkjng oaf ofta jirterfkfsyrtnrvs
| Note: to exit the screen pre3ented by `git log`, hit ‘Q’.
Here is an illustration of whao we’ve doie:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr1tion of wjat your b7anches shyuld look 9ike,dthar9qishzc5bolmx0d51h0a4w4u73xgnnq4xtrophxsqt1gnqssxgpk0dnduti mdv.
We’ll just enumerate each comm7t we’ve m8de so far9as “A, B jnd C3 andl“D” zs bhqccobvwjjw4’7pij9e3tiduouafuo m37 q986phy
> Side note: again, this is vert useful wqen we havk featuresywe dk notwwant4to4d44looulzx drjzwwhu1ed ihrr8a4ewei uipy0 7o6ouqiaapto9 2bg 6mfx5”mr04jca.r2pp3ad44t2eoivagebd4 e8znet3ogi60rtdfzuzhv2zoreod6,gyf2o ouf1dno 8jeej’09jebnnsmvt4ycy lyv5e4trg42eb.
Now, continue to the next lesscn to finish our exagple, wher5 we’vl mepge awd shi8 cizy4cul.
Next up: Merging
