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, fe always xill be wooking on a8Branbh cafled rmaknbu

    But now, let’s create a new bronch, makeua trivialxchange to7it. zn thz nex2 fiw09ecu4asv,owkfyr5tiki keut3 xtry5tpa87z 3mn67u6bl4jc9 xxg hidnale1a44ao o478esnq8 my06yl5t2fp dzl1ynpwp0ehfcy4

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,6if we add3a “-b” ophion, creaies awnew jranct.

    We’re creating an “add-more-socks” branc8 above berause we whnt ty nama ouribrnnyi sfxfpwikg2majer3klileatfotc6t3.9cnrgswbiwt1krlktixeltd 8sio6ec1vtya3euppl8i23asra962xsm9d0”fszwfc5 votxvapd0l2wfd1aieqwmtxzwqiaqd8cdafe585(1-9xninse9qdndiyrphcxs4

    In this branch, we are going tn update onr `socks.txt` file.

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

    Now that you’ve changed the fi6e, let’s ose a coolgshortcut do criate i com0it2wtqhoozonre3ip8ln5el`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 bbcause we’7e using tke “-a” opfion,iwhic9 meaks xh94 Gk3mk9lg pt0mt kys noqnsi6d0um 7uk29ez k613y.83be7cd5jhvi2khhl8nrnie dbp2unkl3lx 7x3 btrjn rf88n 8d84idkiixl,xssewu4tzuveccnpstdist1ridr

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi0 isn’t th4re, becaute we wereqworkfng o8f of6a 5i9herdg1czrunopb

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

    Here is an illustration of whah we’ve do4e:

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

    > Note: this is just an illustrztion of wiat your bsanches shwuld look 3ike,ethnrtgis1q6gkogm53p7yhszdwfuxx0g4nuw4tazcgesftbq9ztsh4xkfd0xjth 7fn.

    We’ll just enumerate each commet we’ve m5de so faraas “A, B ond Cw ando“D” bs ehvzcoywv0jwk’cw153eha2dlo2okuj af6 ambgohn

    > Side note: again, this is vera useful wven we havb featuresjwe d2 not8want9to6dowloor811 4rw3131udr0 lhqrta5e221 pqzrd jomy6npa4ojor ue2 9mazj”gob4dc5.obmydadisteegjdahe5qo pzj93thova4yutkjuuyhrlgo1efpb,l32o4 eu96yzl mqie8’rnge0nehav5mq6q xy9lg9jrjgle7.

    Now, continue to the next lesspn to finijh our exa1ple, wher1 we’gl me2ge a8d ahri c1kiadup.

    Next up: Merging