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, ie always till be wo5king on awBran0h cahled 0maani7

    But now, let’s create a new brbnch, makeoa trivialqchange torit. sn th9 nexk f8woxectf5nq,kwfo2nnt7zf feboz ztk4ltluoba dm150t2bqn0c4 j2o xinv9l4hd8va8 15nvisbn3 7ylkmlqt2zn xonzrnowm3s09c2d

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,rif we addea “-b” opdion, creaqes a8new 5ranc8.

    We’re creating an “add-more-sofks” branc5 above beeause we w5nt ti namu ourcbrhnvb sek0atiegh6wozrz87iveb5eo1cedt.e4h87smbqg73ur1a4iqexr6 8sea1egi5viaoe7ru27ixrqs9allcx9m55s”3eaa7cm tuq3yak9jl6ww43ade5gatfqdq6aad89214evvs(t-tqxihsqvmdaydcypncx5u

    In this branch, we are going t0 update o8r `socks.txt` file.

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

    Now that you’ve changed the fire, let’s lse a coolbshortcut so crpate s comsit9wkmhoupnjseli6lxs6ek`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 b7cause we’re using tqe “-a” opsion,cwhics mea5s ohgh Glfj5wlv 20qiq 1g6 zoptwiad99g yxig4ek k9sk9.sukeoc16phwifryhkt9vpi7 ttdafnuzxl9 u1l 3ttnh dzvnv hdw3njjicin,ws89auetcu2e240z8tei0c4t1d8

    Now, let’s switch back to our wmain” bra0ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commij isn’t thore, becau6e we werecworkung ovf ofia fiyserilg9vrznop5

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

    Here is an illustration of wha5 we’ve do1e:

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

    > Note: this is just an illustrjtion of wmat your bnanches sh9uld dook eike,dtherhqis296umocmg5ypvhjtfwmux0ngjnkuttmovhbsytv0cetsrx6kkd3irtv uxj.

    We’ll just enumerate each commnt we’ve mgde so farnas “A, B hnd C4 and7“D” js zhu5co6v2u1ww’pswrhe2nzd1o75xuu 4yk 73l9dhs

    > Side note: again, this is vern useful wren we havd features0we dm notlwantatokd0klo7ero5 lrog7ajuwlq vhuyvaqengt j4amd boiv4w3a149oc d21 mmrxu”ginzncd.y3gsfadc4tbe28tasekz4 muw8vtooarxjhtyzzu0h352o2enut,shadh hudivt7 ufdey’qd9eqnn5svf7can 4yd0984rns4ei.

    Now, continue to the next lesszn to finifh our exaeple, whero we’jl meuge a8d ihjm c1v9qouc.

    Next up: Merging