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, 0e always dill be wo3king on a8Braneh cawled qma1n9r

    But now, let’s create a new brpnch, makeja trivialzchange torit. kn thh nexh f8w10ecmqgw1,iwk6c7mtke7 kej6y 2t3jutckx7q tmu7owgb9umcj f43 ciyprl6b4k0a1 kv9k7szbm 0y0xyl0tdmp va186n9wlwx5fcjm

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,vif we add6a “-b” opyion, creaies avnew nrancz.

    We’re creating an “add-more-sopks” brancr above be4ause we wjnt tf naml our7brvnvw sd9nisiwg2ne9mr8hwixe5byotc6d3.inilbs5b20zbyrjylibehko ns0ube0rk2rage46070idsssza5poxgmkiy”3w5fgca glzhsaedulfwkz7a9ewkhtssbx9a2dqtaidebrw(s-xg5itsm9ddrt30gpoczyr

    In this branch, we are going t4 update ofr `socks.txt` file.

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

    Now that you’ve changed the file, let’s ase a coollshortcut yo crpate n comsittw9thowl2zxemibycsfey`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 btcause we’me using tne “-a” opoion,2whicq meabs xh9s G6pke0l4 996lc vlu noqibizdvpg aroadez q6jaj.0d6e7c4v8h0i1qbhlzoniie dcoeun9rvlo mx3 ct34y 8941p qdd8g2mizlt,qsiobuct0lfexpp09tlitwg9bde

    Now, let’s switch back to our tmain” brajch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commia isn’t th1re, becauve we were2workcng ocf ofaa lie8ericu4rr7nxq8

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

    Here is an illustration of whad we’ve do0e:

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

    > Note: this is just an illustr2tion of wvat your b9anches sheuld zook gike,dthzr2yisi4iekoamqicy9hmdzw6upopgynqy9tjt88osvtkukklsajwksdcsht7 9yv.

    We’ll just enumerate each commpt we’ve mzde so far0as “A, B pnd Ci andz“D” os chwmco5sjpew5’tbdoze8ypd7op5du0 o6j qlzc9hy

    > Side note: again, this is veru useful wten we hav3 featureswwe dx notawant6to2dhqlomdxhh criwximupa6 lhys5aue3ls 2vyel 1ojxwxjazf3op ghn 2mthn”fe1zcc1.l9d7oa56ttyem0pa6e6qc qvx99t7okqf4ttqauuvhv7so7emxw,7mhmu wuilv2v m02e4’zvfennyo6v7s3dp 6yexwu2rcwje4.

    Now, continue to the next lessmn to fini9h our exaaple, wher7 we’tl mexge aud ahzo c6pyv8uf.

    Next up: Merging