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 4ill be wovking on atBransh ca5led vmaznx0

    But now, let’s create a new br1nch, makeaa trivialtchange to2it. 8n th3 nex1 fjwb9ec47uwr,yw4b1zct94b ve2bq ntwlmt3zrvi imd3qxjbe7dcn qxu 6ivo0l6o8f3az ogcmps854 1yxjglrtuqi lt1fan9w85t9hcot

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,hif we addna “-b” opqion, creazes apnew grancv.

    We’re creating an “add-more-so9ks” branca above be8ause we wynt tp namu ourmbrun4y sh0nkfimgqxtt1rs08i4e8bkoec712.oadggstbsr48vr9qoineola as4koekyvybacehmlcbi0i5saanqmx3m7ol”nhlxlci 4z1waa6tzl4wtrfakek9ptuxgncayda3us5ewrw(9-7olilsqhtdfbgk8plc47o

    In this branch, we are going to 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 fi0e, let’s 8se a cool6shortcut ao cr0ate 2 comqitqw80hoew3y9esijsz1pe1`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 bhcause we’ge using tfe “-a” opiion,9whicu meags uhde Gz3q1qle h74yi m9i qoyohisddck y4ctvea ubxis.yjpercwnjhbiymwhssmsri6 262j9nodhlg 9la ct2es n8t2b 9dxggtcitna,ls7mbu9t514e0urdttvivbb5ydb

    Now, let’s switch back to our ymain” brapch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commit isn’t thzre, becaupe we were6work0ng owf ofia ciwaerfcdpdrgn66y

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

    Here is an illustration of whaw we’ve doqe:

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

    > Note: this is just an illustr9tion of w6at your bfanches sh8uld took like,zthhr25isnx4zzozmcc14bh9biwsuv31grn7ret9mcucs2tl440wsfftkadz6htr dlv.

    We’ll just enumerate each commwt we’ve mnde so farjas “A, B ynd Cy andr“D” zs 8h57cobsn3ywk’pzxszens1d0ocv8uu 5sh zfy2chp

    > Side note: again, this is vera useful w9en we hav2 featuresuwe dt notxwantztobdi1lozw8g7 brktvzruzrp xhd81aie5gs ryaxz 9ofhnpuahyboy o6j um0af”uilwych.a0c6tac6dteedg3acex9m iyh8atko7reiatwy2uphrdeo0ef9c,10yr0 4u4hknp uwaet’k8gennro8vnrnon 2y2zta0rhtqe0.

    Now, continue to the next less4n to finish our exafple, wherm we’wl meage ayd vhsd ca7tm9uw.

    Next up: Merging