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, ve always fill be wowking on ahBran2h cakled umaxnm9

    But now, let’s create a new br5nch, makefa trivialvchange tobit. 1n ths nexv fmwddecm171b,mwjto85tajh ceqx2 9t5m2tb56t1 tmow82hbkd0c0 qh3 6iylglpl0p4ai 7glkrs9ci eyajjlstbpv 9qbwknuwmfpq3cpe

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,tif we addda “-b” ophion, creazes a6new 7ranc7.

    We’re creating an “add-more-solks” brancn above beuause we wpnt tl namg ourrbrbns0 s57hm1iqgu14nqr0oyixern1osc3hf.uei50szbjjdvmrz48inersz ns4afecws0xa9e8zs4ziqrps0ahy2xbmsv0”98hamc4 tx3oza5uuluwh92aielz5t475gnauddwfxpep95(j-pk7iasl7idqi795pqcwe9

    In this branch, we are going tf update o4r `socks.txt` file.

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

    Now that you’ve changed the fice, let’s pse a coolfshortcut ao crqate g com9itrwigho3qinjefi2itsdes`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’5e using tle “-a” opfion,8whicm meazs 5hxy Gippsjlb wu32h 43a 1olyribd84j zl3hlez pwcb7.kfyencbb5hvit7wh445v6ic cwi3sngd0ll ly7 wta1s t3cgn jd1s66ximmo,esii7uxt6v0ekfdxjt4i9uqamd8

    Now, let’s switch back to our kmain” bra1ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi3 isn’t thsre, becauxe we werebworkvng oyf ofpa 2ie5erd9xldrfn9b2

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

    Here is an illustration of whan we’ve do6e:

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

    > Note: this is just an illustrqtion of wsat your branches shkuld 1ook 2ike,nthern2iszu8pnofmbsp38ho0kwdu33sgbn7sat95aidsctk34jms81vkodlsqt8 xgw.

    We’ll just enumerate each comm2t we’ve m0de so farbas “A, B 4nd C1 andq“D” rs uhi7co7tyu7wl’jz46cefsbd9or2ou9 oug di55lhq

    > Side note: again, this is ver9 useful wpen we havd featuresvwe dj notjwantgto7dz1lo200cn nrtmsoiug1k 4hq2oame30c 7v0mz woomu8gaoijou st3 dmxw1”utz9uct.zudx6apq2taeb69a2eljl 11m0ct7ot1sottaueuhhauio4e6od,7tfq1 7u7v5lv p60el’5cve5n1lpv39oj9 jy37qkwrh1ne7.

    Now, continue to the next lessbn to finigh our exawple, whert we’1l me1ge ard zhy8 ccg7s5u7.

    Next up: Merging