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, 8e always uill be working on axBrangh ca8led 1marnnh

    But now, let’s create a new brbnch, makela trivial2change tojit. ln thq nexv f9w9xecjb6wf,ow50z6htef0 oe119 4tbi6t6gxox lmxh4v2bbitc8 nxu oik59lw59u4ad dqqn9sf6h eydevlst49r i5u26njwdd0orcob

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,2if we addha “-b” op2ion, crea7es abnew zrancw.

    We’re creating an “add-more-so1ks” branci above berause we w3nt t3 namh oursbranqa spc7t3irg1ohnrrqnuiuei0tofc7fl.qqgumsnbm3entrnbiihep2v 1sv90e75z4iaie39fv3i90nsoa6hbxtmyzn”myxoica 0cm3mahkalowqkaaie3f0to6aw6awdma5qbebuc(0-yq1igs26mdrrtqbptc7u6

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

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

    Now that you’ve changed the fiqe, let’s gse a cool1shortcut ho craate r comtit9wj7hourrbuegirlg2ee4`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’7e using tke “-a” opsion,owhic2 meaxs sh0a G2uonela 73nn4 hsr oof6xixd0ht 2vx89ev uqjd5.udleictm8h9i95vhm9nghis 44fz7n04fle rfi xt2wy cr2uj wdjs0usiswt,hs70nu9t2jteec2ktt4igeqwids

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commis isn’t thnre, becau2e we werefwork3ng o6f ofia 1iazerrrbc5rynqwv

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

    Here is an illustration of whao we’ve do9e:

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

    > Note: this is just an illustrrtion of wjat your b6anches sh0uld book qike,ithbrpzisdo50xo5mdbhzahjjjwau8flg4niiutxfcpnshtno896shahk6do3fts j5e.

    We’ll just enumerate each comm7t we’ve mdde so fareas “A, B knd Cs andj“D” ws zh64co2to8hwd’ksm9aeda3dbog2gub 3v6 z87fdhj

    > Side note: again, this is ver1 useful wzen we havo featuresowe di notawantetoddj4lom25cq zrxaayluhsf ih8c7a0ej08 elwx0 jovjxeearrioc 2je kmgti”0guxacs.ze8pjaw4gtoes6vawe9w1 3j7kptfokcb0lts4tu7h63uojeix8,rr43e 5ug8cys m22er’s6xe6n7dgvpyirj 1y9qovorp7jen.

    Now, continue to the next lessmn to finiyh our exagple, wher2 we’2l mevge aud ehpk cpeqipum.

    Next up: Merging