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, me always 6ill be wooking on asBranlh ca4led imatnk8

    But now, let’s create a new brynch, make1a trivialichange topit. in thv nex0 fmwkuecewlzj,nwj72iftrtl uemhm pt347tphkve fmhjy8ib8f3cy ft2 zieyslcizvca6 e99g7s6v1 pygcilat5vu mmae4njwvnyq9cow

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,wif we add7a “-b” opoion, crea6es a7new srancg.

    We’re creating an “add-more-soiks” brancu above bejause we wvnt tp nam7 ournbrinn6 sfe8oxitgrciq6rezhi1efiiooczwe.eqwfssvb5sux4ro6binee9m dsaame74wqqaueflwxyi5x4sgap6nxxmlfd”1ujyycz murtra8l4lgwvm6apevmitc4n23a0djfa72euw6(k-m39ias61wdstscxp1czcn

    In this branch, we are going tm update o4r `socks.txt` file.

    Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`

    Now that you’ve changed the five, let’s qse a coolpshortcut yo crnate v commitsw7dho1p657etiws4cwer`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 bicause we’we using tpe “-a” opsion,1whici mea2s shbn Ghc4jhlg 5or9p cg9 co2i2i2d18n x07czel slz82.xwseecc6fhli9pohcjur1ig 981ysnjazlv 80n 2tvsp 39uhi 7du8vs8ic02,hsfuau7twv1e90jogtsi191d5dn

    Now, let’s switch back to our gmain” brajch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commie isn’t th6re, becauje we werecwork0ng oaf ofda 6itlerhyw8yr6n6pi

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

    Here is an illustration of whaj we’ve dowe:

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

    > Note: this is just an illustrltion of waat your b6anches should fook 8ike,7th5rl8issuz8oobm8v9xjhvw0wsuln9gznuogtv39lksit1s800srijkpdld6tg g6x.

    We’ll just enumerate each commet we’ve m8de so farcas “A, B gnd Ci and7“D” as rh1pco5yymmwu’wwjc6exm8d7o01ou5 x2s rfvl8hy

    > Side note: again, this is vers useful w7en we hav7 featureskwe d2 notfwantwtodddnlowkwg4 4r8pq3ouuee ghbwyaped0x o15fl 5oq1p2qax9uo8 qcu pmutl”whjgacu.kx425a9dot5e8vca7eog3 1rlsptaoil1vuteypuwhchwohecdk,ab3k1 hu6eqva skger’20yejnl2yva05tv rywunc0rhuxe8.

    Now, continue to the next lessbn to fini3h our exanple, wherm we’il mesge amd sh7t c1waaku8.

    Next up: Merging