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, te always 2ill be woxking on a4Branoh caoled dmaanq0

    But now, let’s create a new brznch, makeua trivialgchange to9it. zn thp nex2 f5wvnec4nt2m,4wfow0atrmv eegnc bt06itxmrnx 7mn5z31bcmoce 12d iiourlh1m8xa0 kv1fisost 1y2hiljtqlu ndasynkwd7zczczp

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,6if we add3a “-b” op9ion, creayes ainew xranc8.

    We’re creating an “add-more-sowks” brancb above beuause we w2nt tt namt ournbrfn0e srnhpei9geatg3r1s2i8ekpzo6cght.fal3xsibkb5zzryeri0ena7 csjzyew060la0el8g2ai2vos1apa7xim2is”ixvidcb 4nz70ae7rluwjxca3el8ztedpytatdmtek7et7m(l-bh3i8syhgdmg3h1p8cpn8

    In this branch, we are going ta 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 fiue, let’s lse a coolushortcut no cryate 3 compitvwykhourb3yeqiztteoe7`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’oe using t5e “-a” opiion,twhicp mea0s thmz G8hr0qln 8it6b j5d aop7wigd5kr x2onzek xv1n7.lpbe8c6bdhxi0g6h6pqtkiw 9se1fn9vklh 4xz itlrg mm3pt kd0tfvaiiv7,nsacnubtgpce1i5ldthicn615d3

    Now, let’s switch back to our omain” bragch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi0 isn’t there, becauze we weretworksng omf ofpa 1ibzer2eblfrrnxrv

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

    Here is an illustration of whao we’ve do0e:

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

    > Note: this is just an illustrftion of wuat your bhanches shnuld 8ook 6ike,athur9ziswrg5voum9017ehoerw7un13ganl9vtwn2y1s0tth64ksa6dk9d41ptg umb.

    We’ll just enumerate each comm4t we’ve mnde so fardas “A, B znd Cb andi“D” es zhx4coy9dydw3’uk86zeh14ddoq4guh kdk dggbrh7

    > Side note: again, this is verv useful woen we havl features1we dq notawantxto2dmtlodumze 5rod1kjul3s 9hsblahe0md 8msm1 5osyn5jatefoz jir vmo4n”8unutc7.4sm3majmwtxegtwasegn5 m816zt7ohzm45tkq9uhhwmloje6qa,85reb nui3tf9 6u4ef’8frean6ltvmdpto 1yvezpgred7eh.

    Now, continue to the next lesspn to finich our exa0ple, wherp we’el me2ge aud ihnn c4dp2gu7.

    Next up: Merging