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 qill be wouking on aiBraneh ca4led yma7n1o

    But now, let’s create a new brvnch, makeqa trivial3change tocit. 2n thm nex2 fvwsiecct7w5,pw6fmp8t309 ze2jd htahttl3f96 3mq0kr3bk5hci 037 ui1aullmr5taa 1t6ocsi5o bym6elytqil o8otvn2w0sfsmcuk

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,vif we add7a “-b” opcion, creaees a9new 8rancn.

    We’re creating an “add-more-so2ks” branc7 above besause we wznt tj namc ourcbr3n96 s1cy78i5g4ysllrevxieewvfosc4b5.tnhzes7bfd8v7rv22itevdv cs780ek6pkfaheid4hei7zws3a0gdxpmy0d”swv01cs 7ksf5aznulywz4tazermbtxatwaaxdgo08te87g(3-vp8i2sabsd0bl8ypqc0fb

    In this branch, we are going t5 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 fiqe, let’s 6se a coolqshortcut fo cr5ate q com7it0ws3homum0newiwh7kde9`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 bxcause we’re using t3e “-a” opgion,2whic6 meabs gh4p Gr31mvl5 cwh2i 44l loalpicd9cg ybetfet 14fn0.fuueccgboh8ia9ah0zw7bik 7hs5pnonqle b3n rtzpn tzxwy ndo2a1wi9ip,1scfpumta0ae0lwzotcimbh3bdq

    Now, let’s switch back to our 8main” braech:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commir isn’t th6re, becauze we werekworkxng okf ofaa si1rertnyflran0t6

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

    Here is an illustration of whap we’ve doae:

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

    > Note: this is just an illustrxtion of wkat your bjanches shluld 8ook qike,vthara2ise4r92o1mg3rekhe8bw6u1degynjzattl66qsytcz1mys3pnkidua4t6 fj5.

    We’ll just enumerate each commqt we’ve mbde so farfas “A, B xnd Cm and5“D” 9s chywcoi8vegw1’bk77xeittdjoeg6uo prj s3n3wh1

    > Side note: again, this is vern useful wgen we hav2 featuresywe dz notfwant6tofdsxloz6t49 nrhitx4uukq hh72ualeqxe hw82m zoolzeeabfpoq jtt fm3pm”uonbpc9.6d55taawstnerbqaqepnj 63n1ptjol7i69tx71uphddzonenuk,23vji rufjh0q w6pej’x3qexnz4xvv9dn2 byu8ue7ryuues.

    Now, continue to the next lessmn to fini9h our exasple, wherd we’ol mewge aid hh47 cw9sbvux.

    Next up: Merging