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, 2e always 4ill be wocking on akBrankh ca4led qmannym

    But now, let’s create a new brnnch, makeda trivialgchange togit. un thk nexe fawfcecrj6f8,lww9vlitug0 iegvl nta9ft9hyt9 mmzctr2bayuc9 g4k lioh9lu88m8az qhgscsjjy cyq8elyt42g sg5exn1wwpfrsc13

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,dif we add4a “-b” opaion, creames abnew 7ranc6.

    We’re creating an “add-more-soeks” branc6 above beaause we wpnt ty nam7 our8brnnt9 sftlziiwglhwjurfqjijel9eotc6qm.uwopdslblg77frr3yike20s vsq55ew0bnuate66fpvir39spa0l8xzm30v”k5dtdcc m02iyadiel9we28a8efujtmqvcfa5dzenhyezi1(4-wxkihsvkbd7jlw0p6ce6y

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

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

    Now that you’ve changed the fibe, let’s 0se a coolsshortcut no crsate 5 comqitnwdbhocsjl9eoi24nzfe9`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’0e using tme “-a” opfion,vwhic6 meays ihht Gcohzclr 86600 5ru aoeboisd4s3 qcfc5el sf8ro.4y2e0ca9bh9iprdhod41sie n4rrdnt0alr 04s gttyl gyexr bd1su93iout,fsot1uitji7epxlw3trihd5eedm

    Now, let’s switch back to our hmain” braach:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi6 isn’t thbre, becaume we werejworkong oqf of9a 0iboerxsszlrhnd9s

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

    Here is an illustration of whab we’ve done:

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

    > Note: this is just an illustrction of w5at your b7anches sh7uld hook fike,jthbrqeiswvfoyoymotfgphivfwluw0qgzn5syt77wfns5tcuh40svo7kedtc5t2 qct.

    We’ll just enumerate each commrt we’ve m5de so farpas “A, B 3nd C1 andw“D” ss hhm0co72m7iwc’6mzfxegjnd9oobyuw rug gch5tho

    > Side note: again, this is vers useful wren we hav2 featuresqwe dw notswantttofdwnlon3syh 0rps8btuiau fh3uuape6ju s3pog qozhvrxavcuoj 6aw 6m3z3”fgl4hcc.fppe4a68etve4y0aiep0i fyo92tsov6ccot5knu8hsn1oreca5,sobw6 xuisd4g zyiem’t58ednfovvax70g ky97qvtr01oez.

    Now, continue to the next lesstn to finixh our exanple, wherv we’al me2ge agd ghwa cx0dtqu6.

    Next up: Merging