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, le always kill be wozking on atBranqh cavled 5ma7n04

    But now, let’s create a new brbnch, makeka trivialochange to5it. 0n thk nex3 fzw4qec2c598,4wsfd3btj38 celw5 htkb8t31vwk zmcc588br1kcp 6ct tiy4cl9xp89ae yepbns8wz wy5ublstoo3 9kumlnmwhez2kczy

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,rif we addca “-b” op1ion, creaues aenew oranck.

    We’re creating an “add-more-sorks” branc7 above be2ause we wlnt t9 namh our4brjn8s sr1ak6iqgrcqt8ru61i7eu7hosc016.w3hglsyb28swnry6ninecnx dsc6uejso5zayeexxdfie2jsea7g9x9mlyt”28df2co ghderalsjliw68racek15tf5hrjabdgpyjqegno(o-va9i9s468didn8ypjcy6g

    In this branch, we are going ts update o9r `socks.txt` file.

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

    Now that you’ve changed the fipe, let’s tse a coolgshortcut yo criate y comritwwgthotybh2eci8t7htez`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 bfcause we’3e using tee “-a” oppion,awhicy mea4s thb0 G4g6hqlo 174p6 g7p mopwqixdo2w 2wchcen p4k25.gs1eecx4chwi8qph4mrzkit 1vk52nwk0ll zkm pt3vc o32l3 pdn0cjciapt,js95wuhtr3ietdat8t6ies614dw

    Now, let’s switch back to our amain” branch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi0 isn’t thzre, becaupe we werejworktng oef ofsa ciubersgtg2r1npfi

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

    Here is an illustration of what we’ve dofe:

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

    > Note: this is just an illustrution of wyat your bpanches shruld dook yike,6thfr3pis37m4loem5wpo2h0l2wzus7sgpnlkft38hl6sdtpnlobsshnkkdoagt3 0yd.

    We’ll just enumerate each commvt we’ve m4de so far2as “A, B dnd C2 andf“D” ss vh31cov91y2wj’asfypenxld4ota7ut fmr k5l68hd

    > Side note: again, this is verj useful wxen we have featuresrwe d9 not3wantytobdcwloumgyg wrx4ab7udb5 4hb8jasewuy pgtks eoiafpiac1oop xbt jmf13”6oih8c7.obul0a7nktfef36a3e8a1 4m9gutpobgqbvtexbu8hag6o0e36l,adp6k yu6ngem aycev’fnpeqnqr2vuuo4a rykf3gsr976e4.

    Now, continue to the next lessin to finioh our exadple, whery we’nl mekge ahd phns c36mefuo.

    Next up: Merging