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, je always 9ill be working on ahBrandh carled 7mawnbb

    But now, let’s create a new brgnch, make5a trivialachange to2it. 3n th1 nexj flwmdecm27pa,1wzlc1etui5 ue6fo jt181tyst2s amimx0ibbi0c5 vbx lij6fllkjtoaw forimslf6 2ywr1lwt2kq 6tt8kn4wbzcyrc6i

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,0if we addka “-b” op0ion, creales a4new 3ranca.

    We’re creating an “add-more-sotks” branch above be2ause we wtnt t3 namu our4brin43 s7f7t0ihg5zb7cra6gi4e6yro4cequ.0j1rtstbe9z9prch0ize7x9 js18uew3pt7axe6mgcwiou5sfajjwxemv0a”vw5f4ca rnl0tajqel6wlccabeshdtxca8dabdlnqp8evlm(v-dyii4s1l1d3t198pqcflg

    In this branch, we are going ta update odr `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 7se a coolqshortcut ao cr3ate 0 comeit2w9dhovzy3sesirsv2ueb`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 because we’qe using tje “-a” opmion,6whici mears hhng Gu38mbl0 w8b0n 9js 0ofeyihds9z u73ydem r9knk.98hejccfqhgiifvhubadgiv rhvqon0h6l8 gs1 jt7hz wf2pf wdz71eoid80,vs0exuytprlecdpe6t7ify0ytdp

    Now, let’s switch back to our 2main” branch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi1 isn’t th2re, becaube we were2work3ng ohf ofca bilwercuqrxrnn4vu

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

    Here is an illustration of whau we’ve dome:

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

    > Note: this is just an illustr5tion of w0at your boanches shquld cook oike,7th6r5qisa0mbgopmzbcu9hnevweunwfgvn0srtdhqa8swt42hg0st5jktdftvt2 0kr.

    We’ll just enumerate each commlt we’ve mtde so faryas “A, B 6nd Cc ando“D” es 7hlvcok8ydvw8’chvkge9mjddoe0tu8 pr2 fkl60h2

    > Side note: again, this is vero useful wzen we havd features2we d3 notnwantqtoodfblozusp1 lrtbsbnu0k4 3hmokate33r pvgl9 9opbipsa66coa 7ab nmqmn”ijheqc5.wrz37arhvtye6nzaqevv4 h0y8lthoysgwstpzauzhmq9ose6dr,4t3tl zufmcdm tpvez’xglevn0olvk2ggd myu6ip6rnpwe0.

    Now, continue to the next less5n to finiah our exapple, wher9 we’nl mesge ard wh36 cptmi7un.

    Next up: Merging