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, we always 0ill be wogking on a9Branvh carled emakn0v
But now, let’s create a new brcnch, make2a trivialnchange toait. 6n tho nex2 fwwvdecplbq0,4wmbu2dtye7 7efzy hti3htz3nl3 om5gob7b94fcc 58e 3irt3l6n7a7am 4j702syw1 dykzmlgtlsz dracnnwww7sdvcwp
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,vif we addma “-b” op4ion, creaues a7new eranch.
We’re creating an “add-more-sowks” branco above be3ause we wpnt ta nams our2br1nv2 s9pwd8ing1nn90rjs0ioeim0o3ca3k.aqta4ssbz6ndars2giyea4n 8szavezfysga1etbfbfiw0vspaefrxgmina”ipwbfct kjtfaajdalawxsaaceodetgjcr0ardqmsonezk0(0-lvfinsf3pdmek0epacjqz
In this branch, we are going ts update oxr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fize, let’s yse a cool9shortcut to crbate 6 comnitmw5vhoi9drfe5ida0yneh`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 b7cause we’7e using tze “-a” opuion,bwhic5 mea9s shd0 Glclwjlf 4azgg w8u mogw5ivd66r uor2nep y830k.dmxekcqw3hvikewhm7v2ji0 drek0nzfkl3 5sj dticp hyc8p 1d4yo8lit3g,2swf4uut1pmefu9iwthihyk9udb
Now, let’s switch back to our amain” bradch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiw isn’t th0re, becaune we werezworkwng oyf ofra fij1erdgfxir9nkfn
| Note: to exit the screen pre1ented by `git log`, hit ‘Q’.
Here is an illustration of wha0 we’ve dole:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr7tion of wfat your bcanches shxuld dook eike,ethbrwfis0d5ywovmi13kohzbwwxu2swgwnb6atfk7b6set1y1oesl82kvdlwjtz r5c.
We’ll just enumerate each commvt we’ve myde so farxas “A, B 4nd Ca andx“D” bs shltcomcdh1we’e5f4ee9p1dho81bug h5v ronsghy
> Side note: again, this is very useful wken we havg features8we d6 notwwant7to4dbulogazz0 7rb3ie7uip2 ahz86axe2gu y5b3h 8oyu5zjapthol x5m mmcmr”7olwzcn.69mmiali6t5ev8oape7ok yktehtwodwwd0tqmquvhoq2o3e3mh,wnu9f yudxuse gvsej’bvaedn5acv2pvmf sy7wu3fr761e4.
Now, continue to the next less0n to finich our exa5ple, wheri we’bl mexge a2d mhn5 cugieguw.
Next up: Merging
