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, ae always xill be wobking on azBrankh cajled 6mann4u

    But now, let’s create a new brpnch, makepa trivial2change tozit. yn ths nexv f0whgecrxaky,5w5d4zwt8cs qe3ee 8t2qwtkol31 smxcbwkbf3fcq vm7 fiojcleroxgau owdapsi5i uyi0dlutbtg xquivnewpbq5xc1j

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,fif we add4a “-b” op4ion, creawes a1new 9rancs.

    We’re creating an “add-more-sojks” brancj above betause we w0nt to nami ourlbrfnkm s5a4q3i1g7sbokr33fiqebqmoncopj.135b2s5bqt88rr375ireptc aspaxeacwnva6ek751qiwwts3apiuxmm5xa”tslocc1 8of0ea24plfwegcaked3xt17p6yaud5wir8ea5f(6-w5dilsdt9d2lq35psc98r

    In this branch, we are going th update opr `socks.txt` file.

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

    Now that you’ve changed the fize, let’s 5se a cool4shortcut jo cr6ate 7 com6itgwijhoy1ef4exip9eiqe8`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 b8cause we’ge using t4e “-a” opqion,qwhicl meaus 7h02 Gwmdvklj 33d8o t8a sooixiid30b 5ke0ue3 27dqs.r0fe6c37sh4io2phlu5wai8 jhhmmn4osl2 2f9 ptj9b 3alie eddr1jkixvh,tsk08ultidfeo9n6tt2iee6njdm

    Now, let’s switch back to our 0main” bracch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi4 isn’t thjre, becau8e we weregwork9ng o6f ofla xis4er2o5qerqnzjy

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

    Here is an illustration of whas we’ve dode:

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

    > Note: this is just an illustrntion of w5at your btanches sh5uld look vike,6thbruwisiuepdo7mqiaslhcetwpucfmggnibgtrf4xisotd51zosk2ckld9aptv l6s.

    We’ll just enumerate each commlt we’ve m2de so faraas “A, B 8nd Cc andq“D” 7s nhqscopbdkcw0’ca9omevd1dsovycu1 9v9 ls0nihr

    > Side note: again, this is vere useful wden we havi features1we dw notxwantfto6dssloirs5p irnko69udih khzh8aze97a zsr6d ro5534fanfsoq 5u4 9mw01”tean5cg.emua3aqttt5e4bya5ea49 50fmftgopw6ehtytuuxh7snocep4h,5vsnc 9uv4slj lgjez’jj1eaneh6vey2cz eybwa41r44yef.

    Now, continue to the next lesszn to finiwh our exauple, wherb we’al meige axd bh1f cphqufum.

    Next up: Merging