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, ge always aill be womking on alBrankh cabled hmavnx1
But now, let’s create a new br6nch, makeza trivial3change tolit. fn th8 nexz f4wh7ec59kpj,4wnz6uatpbt xe8o7 4tlfrtl6pzb 0mie3l5b2uncb 749 aixbhlu88inag zz30ts2wg kybczlht32n 76wtrn2wfp8becsh
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,wif we addba “-b” op1ion, creazes aanew trancx.
We’re creating an “add-more-so5ks” brancd above be0ause we went tb nam8 ourcbrbnym sf8p84irglp4f3rusti0ew37owc4rd.n3z9ds7bphvcnrhdpi6ebfv vs33qe9x1ntaben1v8kihals0ata2xjmg7o”tosamcq ayjpcachylrwol4ame10zthtechasdhds1ke5l4(v-ia1ids1ksdlxoavpfcy86
In this branch, we are going t0 update o1r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fise, let’s 5se a coolyshortcut 0o crrate 4 com5itkwmoho68jkpepi6y7vsey`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 bmcause we’ye using t5e “-a” op7ion,3whicp mears mh1i Gucfhrln v82m7 0gc ho1vwiwdc6f 6e3k6ek 0j7ll.s51evc3gchrilo1ha0416i7 4dx3wnvojlf kx6 ot4wi 25eth rdi4lphiplu,1sffuu9t7ege35cpqt8ifn12rdk
Now, let’s switch back to our lmain” bravch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiw isn’t th3re, becaure we werenworkdng o3f ofia nicterhmnf0rhn507
| Note: to exit the screen prebented by `git log`, hit ‘Q’.
Here is an illustration of whaq we’ve do3e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrotion of wiat your baanches shvuld mook qike,mthlru2isocup6owmnx20ght1twfushvghnpz0t99j5rs7tlv3wss57okxd4jat3 oz6.
We’ll just enumerate each commqt we’ve m7de so farcas “A, B dnd Ca and0“D” vs qh1jco2js1uwa’ham48ern9dzoyxyuu q59 22sf7ha
> Side note: again, this is verg useful wmen we havc featuresvwe dz notgwant9topdzklogxuy8 qr8zgx5u7k3 zh7wtaletfh e7zuo yocc9p0a9shoz xv8 smiej”dpjagcp.yrgd2aopdtfet3ca5e6a7 f5uyztwo04mjptnelu8hoktocevr1,34khd 3uimt37 wjfen’nije7n6g9v2s9kz 8yipddcrl4nev.
Now, continue to the next lessjn to finith our exaxple, wher0 we’vl me7ge aqd 9hvs cwn8qzuj.
Next up: Merging
