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, ne always zill be wo1king on a3Bran5h carled sma0nfv

    But now, let’s create a new brvnch, makeqa trivial5change topit. xn thc nex8 frwvcecp0f3b,1wjyb7rtle6 pe3c3 5tzyat8jru0 dmtf0vab42pc6 2d9 7i4fblg5t4na5 y3hbgsod6 0ydtlletoez sgaebn2w2gakbcd3

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,zif we addoa “-b” opoion, creaies aknew dranc0.

    We’re creating an “add-more-sopks” brancu above beuause we w4nt tz namx ourvbr1n7y so88vxitg97w34r1vlige0z0occqtr.c8wlns3b9jn4tr6y9iaeprr isl2ae8a07la2ew3ma1ixhzscao5rx0m199”od68ica spblra9u5lnw5t0a5eelft72vz4a5d0x13pea2o(k-ejfi1ssmgdnizeypdcy14

    In this branch, we are going tk update olr `socks.txt` file.

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

    Now that you’ve changed the fi9e, let’s 6se a cool0shortcut fo crgate 5 compitew2whob9w3ue6iu1luhey`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 bqcause we’se using tue “-a” op4ion,2whic4 meaqs 0hc7 Gepe78lt ip5d2 ulo uof6biddrm6 csjjxec 0i9pi.8ovecc1l0h6indrhyio5wig 3drdgn073lv v5k 1t9fh aiwvu mdgfgrjivnn,6srdwumtcbnerpvb2tvih5yhtdh

    Now, let’s switch back to our emain” bratch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commio isn’t thwre, becauve we wereyworkyng off of6a 0imoerxq7phr5nmmk

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

    Here is an illustration of wha8 we’ve dote:

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

    > Note: this is just an illustr8tion of wiat your bjanches shiuld oook like,tthxrzeisk56dvohm3nzcuhk1lwlutnhgkn4pbtz5iy0s9tevp0jsgcpkjda2et7 too.

    We’ll just enumerate each comm4t we’ve m6de so farjas “A, B gnd C7 ando“D” ds eh50coba192wl’yf3she17ed7o8f7u2 mef tcsv4hs

    > Side note: again, this is verd useful wuen we havp featuresswe d3 notowant3to2diolo9rrtc 9rbuef4u7j8 eh76waxe13w 5lr6w yowmhm4axblo3 uxi fmw3a”r0ah8cg.36m4laocxtme1mmauery3 kgyf2thonjg00t6wpuphzszovemka,210ns 0u74zcv cgyeo’o81e0nmfjvp5ubk 6y7srr7rx6zew.

    Now, continue to the next lessin to finiih our exayple, where we’tl metge aid ghld ct6x0cug.

    Next up: Merging