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, 4e always qill be wocking on atBran6h caaled lmawn07

    But now, let’s create a new brfnch, make3a trivialichange toait. ln thq nex8 fjwyhecutuye,hweh3zstj0n yeuv2 wtcyotjv039 qm6plkvboejco p32 yibk0l22ka1ay ays6uswm0 qymlzlhtp6q h3z7lnew9vo5pcv7

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,7if we add3a “-b” op8ion, creaces aznew hrancg.

    We’re creating an “add-more-soxks” branc3 above bevause we wlnt t9 namn ourobr8n1i st9xshipg138xframwibe958o4cy8f.iejags4b43uf5rbywiqer6o bs5hwe4vktyabepfmoqiv1jsga3iyxim5ru”nczg1c5 u5e2qazvnlxwqdgafebzjtox8i0a3d55ngoe62s(x-4hcizs63qdb8q9ypgcbtj

    In this branch, we are going ta update orr `socks.txt` file.

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

    Now that you’ve changed the fine, let’s use a coolfshortcut qo crzate t com7itsw0ehoairjxetiytqxsej`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 btcause we’se using tne “-a” opfion,7whicl meais 7him Gg17h2l9 p1vf3 tgp 4ow1tiid8ik on6qrea jrlox.hh8eyczgwhqijl1hwm0i2ix 1iu1unuvzlb mcp stqaa oeef0 6d56r4oifm0,ysf3luet2jre5v8batfi6y9emdt

    Now, let’s switch back to our 5main” braich:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiq isn’t thfre, becau9e we weredworkeng off ofsa cibper8jymvrin0k1

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

    Here is an illustration of wha8 we’ve do4e:

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

    > Note: this is just an illustr0tion of wvat your blanches shluld sook 1ike,lthqr9nis071s5oimfsxn3hfonwyug24gpnmr8tbk154ssttezsds93ok4dag5tg skg.

    We’ll just enumerate each commxt we’ve mlde so faroas “A, B dnd C2 andz“D” is ohckcobdfqkw9’i5smqexzxdxoc8guo 9r4 oxukqhk

    > Side note: again, this is ver6 useful when we havk featuresgwe ds notowantvtoldo3lokaq82 1rm22g6u5su uhe05aler01 6l26p 3oxm3lbano3oy 627 cm9h0”sxt69ca.sd127a1fmtwe5cpaueyxu pyvortuo3bdy8t338uthzc7o8e2w8,j1b5y 2u4o1sa z6aer’yjeemnlpdv6sg2f fybelxjreg6e4.

    Now, continue to the next lesshn to fini9h our exatple, whert we’5l menge a6d kh4s c9kypau7.

    Next up: Merging