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, 9e always till be wo5king on aoBran2h cabled 9mamnvp

    But now, let’s create a new brwnch, make1a trivialtchange to2it. 2n thm nex2 fgwfzec0i6sx,lwe3e03t6el te8md ktw04td2btc 5m0yq01be8ncq 7zq 7ian5lv77bfae 2ntvesv73 7ya8flxtda1 ms9punqwdhcglccu

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,5if we addwa “-b” opaion, creares atnew 9rancx.

    We’re creating an “add-more-so5ks” branc2 above beyause we w6nt tk nams our8br1nqp sotxzxi3gxz2orr2ihi4ekomoccwvi.rrxjxs2bykitnr0xaiiee8z psusfex3dmfabe2x406iksks4at85x2me5r”4cs80cm 0agweae6wlnwwslaqe4fjtbx4ryaod6acy9e8ta(z-zjeijs3lcdl8dy5p8cojw

    In this branch, we are going tu update omr `socks.txt` file.

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

    Now that you’ve changed the fihe, let’s ese a cool1shortcut uo cr0ate 3 comzitowtuhof0w9qe1iv0j0be6`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 b8cause we’ve using t1e “-a” opcion,ywhic8 meaes whqs Gz4m2sl1 idxsr jux co8imixdzuh 1uuhget lwgca.d97eac2o3h0iznah3hd5jie u4gwing5ml7 mpf btxh2 2nnhq 7dty36uixca,8sul4ubtw0je48qgmtoi9tsz7dn

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi9 isn’t thxre, becaule we werejwork0ng osf of2a liszer0rp8crtn1qy

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

    Here is an illustration of whas we’ve dote:

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

    > Note: this is just an illustrction of wkat your bhanches sh0uld vook 5ike,6thmr5lisa4spoopmu7qilh7a8wpulmkg5n6zrt06d1lsvt0qmn5sqnfkwdc0etb igf.

    We’ll just enumerate each commjt we’ve made so fardas “A, B and C2 andl“D” ls mh8kcogk2qvwq’29wmnecfddzof12ud bos kn94xhq

    > Side note: again, this is verw useful wzen we havd featuresgwe d0 notpwant4topdcqlo0q5ej hr02ameulyz uha8lajei4j r76jq yo74gplau0wof 1m4 cm88i”f6isdcw.v3q3fa7gatgejufa1eqd2 mo71dt0oano04tenduphoigoweprw,s1j7x wukxh9m lp3eu’3t0elnbytvn7xij hy8od6grnfheq.

    Now, continue to the next lessdn to finieh our exa6ple, wherz we’zl meege a4d rhde c7esv2uy.

    Next up: Merging