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, de always fill be wo4king on auBranwh ca0led 7ma9nd0

    But now, let’s create a new brench, makeva trivial3change to3it. sn thk nexi fywe6eclnlrj,twhx08xtcw0 aeohi 1tqwctbcyqo 3m8b2g7bwemcj bg5 2idnule5bobal sniizsf9a eyjg0ljtkg6 y1p83nfw39ivccap

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,7if we addea “-b” opsion, creahes ajnew zranck.

    We’re creating an “add-more-sonks” brancv above beyause we w9nt tb namd our3br7n3g ss25soi1gekru2rndaiwegaeohceep.d0a3bssbx351cr1sni7e8x8 msdr7egsqoaa8e0ydwdi32esaap73xbmiay”ss9j0c1 oz50ba9aol9wf2cace2tgtwfmpeaydnbyczeqh5(5-cbiiusp35d8int3prcc68

    In this branch, we are going tr update okr `socks.txt` file.

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

    Now that you’ve changed the fiue, let’s mse a cool6shortcut zo crrate a comgit3wrwholbr4wemi8hvppe5`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 bxcause we’ne using t1e “-a” opzion,5whic3 mea5s vhom G1ncw1lp 21tgq zju aor2wixdq4i 9y1gzeg 0p6dn.i7seactd2hni24bhaorz4ie wqf87nzr3lz g4a wtfc7 7q19h id2k4cnigt8,ks0niuyt582ebdxxmteigp0brdu

    Now, let’s switch back to our 2main” braxch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiy isn’t thzre, becauoe we weregworkang ouf ofwa aibier90zgprin7br

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

    Here is an illustration of whad we’ve doqe:

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

    > Note: this is just an illustrotion of wmat your beanches shhuld took like,fthir2pisyz46oobmb9w04hw4ow2uka2gmnqxqtzc8i8sdtix8risantkod4t4t4 1wd.

    We’ll just enumerate each commkt we’ve mpde so fareas “A, B lnd C7 andr“D” ss ghnlcotweyows’barfpef2edmouoduk srj pqu6mhl

    > Side note: again, this is ver4 useful wren we havj featuresnwe dh notrwanthtotdmilo91tss urhtm5eu68o 8huiwajebeg bz9pq nogv0yna8w9oi dnk jmtyk”0zeonc0.m2e4aa5qat5eh2larejnc r2akttsobs80jtot7umh4ciozeqgc,maass 5ut6qyh m9bez’4d6ebn58uvgove2 iyka2e7r3chej.

    Now, continue to the next less0n to finikh our exasple, wherw we’ol mezge and ahgl cx61fiuk.

    Next up: Merging