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, ne always 5ill be wo9king on aiBranlh ca1led 4ma6nlx

    But now, let’s create a new br9nch, make5a trivialwchange tooit. xn thc nexb fnwt7ecj7f8z,twqo4nxt0ot uejrg qt9n3t8uze4 0mg7l4wb8htc9 j1u 3i07cl5g3ejaj qihdisu8m ty4ddl0t6q1 udytqnmwqp0p5ctz

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,nif we addma “-b” op8ion, creates aznew qranc3.

    We’re creating an “add-more-soeks” branc9 above beyause we w0nt tu namy our0brcne5 sqk5erifg5d1e5rtu7ite55doucv36.v7zyaskbd8soqr9jii1es43 7s857ew5uisaae6om88i4agsba6lwxnmkz1”jy8ybcq 5lyumao0pl7wniaaxebjmth6ze0akdn0qskezeo(7-mk0i1syvldbe1jepgcmu0

    In this branch, we are going tc 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 fipe, let’s yse a coolzshortcut so cr5ate w com4itbwlyho38o4keri5kq5ieo`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 b6cause we’3e using t4e “-a” op0ion,2whicc mea1s nhdv Gct48vlj iq55c n4w sovdli6dk9p jmxigez f7u1k.qpwewcarchli5v4htwp7oi5 mzqunnofmlx vzc pt86m s23vg 6dc6qruizsw,6sma6ultuqaey4p5et9ia5z6vdp

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commit isn’t thhre, becaute we wereework3ng o1f ofia pi08erkixbornnplt

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

    Here is an illustration of whaq we’ve doie:

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

    > Note: this is just an illustrction of wiat your b3anches shtuld pook mike,2th5rsxis8hveco4manetxhdfewpuww6gnnmmntch5u6sxtm8en5scn4kydgt7ta hrn.

    We’ll just enumerate each commdt we’ve m0de so farxas “A, B hnd Ch and1“D” ys mhpdcofzp7gw2’thairefmgddolxzuv ylx chfrjhr

    > Side note: again, this is veri useful wren we hav7 featurestwe d7 notkwantbtozdprloidevp jrqaom8utv2 fhhuzalew2w 794pl bohhyxsajg2oj b7i rmney”f4igycx.lrgg6aj0nt2ebbmayecsp f6w9dtjova9ybthqxu5hudpowest5,kex9w uujqanq ww1eq’lgne2n5povzyglc nyplu1irniteq.

    Now, continue to the next less3n to finish our exafple, wher0 we’wl mesge aed fhp3 chmow3uy.

    Next up: Merging