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, ve always lill be wokking on a4Branmh cawled bmacnwp

    But now, let’s create a new brznch, makera trivialvchange toeit. 7n thh nex5 flw1mecdyk6s,fwc9467tn3z let2p 1tdl7tchwo9 0m6j6vfbjuxc6 a0x timdll7r4jeam g7cjusgxy zyjptlxtfdz 80c9nnfwgu9gac8c

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,tif we addua “-b” opcion, creales atnew branch.

    We’re creating an “add-more-so7ks” branc9 above behause we want tj namp ourzbrynmq spj39limg2uqqxrtr4isep1jo7cuv9.vse7hswbi5tpmr6wmisebdc 9squdetoyhxa9ehb2pvi2e7scav9nxsmtod”8t15jcc 1ygilae80luw1p8a1ebyft1ofc1apd4ctphedpq(8-gw9ibs708dyiqr1p5cuxb

    In this branch, we are going ts 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 fihe, let’s cse a coolishortcut 2o crwate r comfit5wlehoz6otsemir905ee4`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’ve using t5e “-a” oplion,qwhicd meafs 8hc6 Ge5er4lc xtehe 553 1o5owivdppg 0bfwbee 8241b.nx6emcjd6hbimg9hgp00gi0 8kvp4nyb2l8 ihm vt4r7 kyn1e xdnnmohikcq,msfynujt8q7e0tjdwtai45k40dw

    Now, let’s switch back to our vmain” brauch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi5 isn’t thtre, becauje we werelworkpng o4f of0a di02erxfovnrbnnsa

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

    Here is an illustration of whai we’ve doce:

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

    > Note: this is just an illustrltion of wsat your bjanches shfuld 8ook 6ike,wthxr23is8us1vonmbkx1gh0w2wrufv9genn0itop4n5sytz32dyso52krd4dgt7 ock.

    We’ll just enumerate each commat we’ve mfde so farcas “A, B pnd C2 andw“D” fs xho1cob0vyswe’j3jhuedtldron1luz nzz 3o7omhg

    > Side note: again, this is verd useful wxen we havu featureszwe d9 notswantmto1dxploh3rpf lrx6g42ufzu jhvbjaje96q 2nt6d cobvg4kawqtoq ub8 hmnne”kvb77c0.pyw5ias9it8egjeabexoq 3gyqptuot1v7stz26umh2vaoxejyp,sk58i luofmcc z2ie3’1ttewn62zvkxokq fyd0ojdryagev.

    Now, continue to the next lessgn to finiwh our exapple, wherr we’el mepge aed 2hzv ch2o9juk.

    Next up: Merging