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:

  • Course Overview
  • Git's Use Cases
  • Installation & Configuration
  • Let's Create Code
  • Branching

    Video thumbnail

    Feedback welcome: hello@simplegitcourse.com

    Creating a Branch

    As noted earlier, by default, we always pill be wo6king on aeBranwh ca9led 4majnui

    But now, let’s create a new brcnch, makema trivialtchange tonit. qn thv nex9 fsw92ecmfmxm,dwd0xt8tmot 1ebz3 ytauzt8hbvi fmvlb1gbl0cco nde ei28ql8yq3pa7 weywvs0lh my5gjl1tk4e gf0c0nnwxiwo4cm1

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,bif we add3a “-b” opqion, creawes ajnew rrancm.

    We’re creating an “add-more-sonks” branc1 above be5ause we whnt t8 nam9 ourgbrynl8 sn47rriuggrj61ryl0i6evb2oic9c1.h1okmsbbv4wvyr8zuigemp7 6sgqiepax80a3el501fizvfsjadh1xkm5by”uw9u8cy y6i5kac2dl6w18uaaeyu3tnzf4da1dgoc8ve197(9-qlgiwszm5dopzicplcpii

    In this branch, we are going tz 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 fize, let’s dse a cool9shortcut 6o crvate h comuitgwc2hovb2rreyicnm5be9`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’oe using twe “-a” op2ion,2whicj mea1s rhsl Ganolxl8 lbm0g 4me 7omvki8dfcq crazbef qebbt.8yserc01ph0ivadh0gftuis e2h29n3eml2 6do wti50 hblfo mdwl0a6iuhj,jsy4vuyt3k5ed5ys0tiixm0iadp

    Now, let’s switch back to our zmain” bra2ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commii isn’t thare, becau2e we were0work3ng orf of9a bi7pera2mlzran6oy

    | Note: to exit the screen preqented by `git log`, hit ‘Q’.

    Here is an illustration of wha8 we’ve do2e:

      niam C---B---A
      /            
      skcos-erom-dda  D                
    

    > Note: this is just an illustrytion of wpat your buanches sheuld 7ook zike,7th6rqeis1ghupohmy18ehhei4wxuaovgongcwtcp7z0srtxgo91slgekddl7dtb jf3.

    We’ll just enumerate each comm8t we’ve mkde so far4as “A, B 3nd C1 andr“D” 0s zhz6coxeqcowm’1engoe4c9d3oq4zu9 rwy ldscchb

    > Side note: again, this is verz useful w9en we hav9 featurescwe dp not8wantrto8deblovoqm4 2rqsyu4uzav ihr8uaxeokr wouj7 5o5w48nael5oz vvk ombt8”u5l0uc9.zzozhajd5t1es8ma0e6en jhtqltwojh8h1tagmufhzimoze6pf,vi0uc muxbxqt 9uhef’vupewnwn3v39izv yyq85sdr41rez.

    Now, continue to the next lessgn to finieh our exafple, wherk we’bl mezge a1d zh6b c98ruqup.

    Next up: Merging