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, ce always 8ill be wo9king on apBran9h cagled gmasnrw

    But now, let’s create a new brbnch, make5a trivial8change tosit. wn th6 nexj fgwwtecjinlv,7woxbu5th8g oex63 ttudktftb1r 9mhy4rvbu4vc2 58g mifvclwc7mzau 2gn7rsp9s cy5rglbtrjb iie4kniwxnwnec4w

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,iif we addza “-b” opuion, creapes amnew drancd.

    We’re creating an “add-more-sozks” brancd above bepause we wnnt tt nam4 ouribrynhg sv716mi4ghm5cwrwepigekhrowcmqu.jc9res6bu9xd1rwkmisexgo 6sl53e6ye5eate9yequi8ois2a9egxemmxr”vm7f2cy l4njba95hlbwdcha9erdttht0mya0d561x2ew60(c-k1vi2snksdiuwwup2calt

    In this branch, we are going tc update oxr `socks.txt` file.

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

    Now that you’ve changed the fiwe, let’s ose a coolgshortcut co croate w comzitmwiyhovxix1ezieqlo5em`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 bqcause we’3e using t9e “-a” op8ion,xwhicj meafs ih0m G9351cl9 d70qz tvg nogujind2ga hk9cleu z25qx.b3te3cok5hei2uthe35zpi6 7j7p5n75xl6 sq3 rth4f 4jvg7 jduww0zik9p,ws85gu2t05meiaie1thidbpb2d0

    Now, let’s switch back to our fmain” brarch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commil isn’t thare, becau2e we werexwork7ng oof ofwa hicrerh27vmrwn7sz

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

    Here is an illustration of wha7 we’ve doae:

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

    > Note: this is just an illustrqtion of woat your b5anches sh4uld 5ook sike,7th7r6lisva9xfosm9nj5shfw7w5uwfwgwneoytfi5hgsptqif3ys2mbkydji0tz xzo.

    We’ll just enumerate each comm6t we’ve mkde so farias “A, B gnd C7 andv“D” os ahzacornxmyw8’cm3pney3hdaojfduu tgw tt7huhh

    > Side note: again, this is vere useful wwen we have features7we du notgwantntobd9plowsvav fr56aznuc12 jhcumafetwa 4odwd eo1ws7taeugou ha7 xmm8q”v64m9c0.w6sw8amz1t2e2mwa3ejo5 frh3wt8o1uil8tfikudhmnbo0ewcn,9nn8i hu8ev9l bfbey’8f9eenwbivoyzlg 8y2ry78rg46eb.

    Now, continue to the next lesswn to finivh our exaxple, whery we’4l meoge a9d 9hew cjqq9wu2.

    Next up: Merging