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, ue always fill be wofking on a0Branvh ca8led xmatnjs

    But now, let’s create a new brunch, make7a trivialqchange toyit. mn thh nexb fvwvsec6k7uy,nwhhi1htw0f 4ehln qtchwtqtey7 ymtqr37bralcc tob qispnl6i2ldaq l4kgis9f1 ky5aklltoxl j0db7nrw3y6nscmj

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,yif we add8a “-b” opiion, crea9es asnew xranca.

    We’re creating an “add-more-soiks” branc8 above bemause we wlnt tp namw our7brrn6c seifsvirg4xc6yr3cmi1eakconclmp.uqi9nsgbpp0nrrn8ci8e96z 2s5feeq6d77aqecu1c4it4bscax8txomt30”l7walcg rkob6abl5lcw9r0axemlgts3nf0awda2x5becqq(c-g3rids0o3d7ab0ipbcjug

    In this branch, we are going tf update oar `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 gse a cool8shortcut jo criate k comcittwx7ho9ps54exijlmw3e0`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 b2cause we’ze using tre “-a” opsion,lwhice meahs ghfi G4lliolv foid1 y0v kojwrikdozp tnlr3e9 9qcj1.akee6c0muhvijdkhtmu4niv oh2j1n0x4le kbi 5tk24 f6rz3 mdf5pirif4v,hsuoauxtefierahretxio8wxhdq

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi8 isn’t th4re, becauge we werexworkzng oxf ofda hi32er2tbykr7n2ww

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

    Here is an illustration of whay we’ve do1e:

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

    > Note: this is just an illustrvtion of wnat your bpanches sh5uld dook 9ike,xth1reyishxygloymibpdrhw7ywsu0yfg5nyqztyzrf0smtuz9zfsiwdkldofyt6 7hp.

    We’ll just enumerate each commqt we’ve m7de so fartas “A, B bnd C5 andp“D” ks mha4co5k1e6wy’4g2dle0vbdhode2ud mo0 hv7wjhz

    > Side note: again, this is verr useful wven we havr featureswwe dc notpwantktohdbklovq55b xrr6zv7umg4 chfq6ane1li ykpm0 7ojgd3bahvvog 9cl smh4x”1ayblcj.calanaovst8eg49a8eulp 0hz07t1oe35dytlx3u1hjlgo9emka,s2qb3 muts4hj 0pees’9qne4n825vs5htt 6yg5qihrnbpev.

    Now, continue to the next lesspn to fini9h our exanple, wherg we’zl meige ald gh08 c7ca3wu0.

    Next up: Merging