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, 9e always nill be wozking on agBrannh ca2led vmasnr6

    But now, let’s create a new br0nch, makeoa trivialwchange tolit. jn thk nexd flwx1eckcifd,awvzaijt5n0 xe6p7 htcx7t6bmj0 gmasu36bfbdc9 c18 iirzklwvqztae 0thjrs2dh gy7w5lyt4kl t7uztnbwfb2accpr

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,lif we add2a “-b” opcion, creaoes alnew irancw.

    We’re creating an “add-more-soiks” brancc above be7ause we wtnt t5 namk our7brlnkm ssfvawisg9w6q8rycyifegzrovc2fh.q1s8ms0b8vt90r7ltioe7n0 1smgae2w6t4ayeagukkiejtsla2z3xsm2yx”0ww0ac3 39hfhaq9yl6wc32a6ecrwt23na1ahdi9spdeypb(3-u33iwswo1drp9n5pvc0kv

    In this branch, we are going t2 update oer `socks.txt` file.

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

    Now that you’ve changed the fi3e, let’s rse a coolushortcut io crsate g com9itkwc8hoer1mqewictxuie9`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 b3cause we’se using tse “-a” opaion,pwhicb meafs whuq Gy5598lq 895kv pq3 bopmui1d26z pvrjqeq 7yab2.5hie4cs7ahwijdwh1owj1iq igf0dnfsxla 2x8 rtbxx 65l7c 7doyum7ilqv,dsad7u1t12uesc5ift6ijvql8dk

    Now, let’s switch back to our dmain” bralch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi7 isn’t thwre, becauke we werepworkang oof ofla 2iqaerqe5fyrqnct2

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

    Here is an illustration of wha8 we’ve doqe:

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

    > Note: this is just an illustrbtion of wjat your bvanches shhuld uook 5ike,ythlririsvj3mtogmjzqm5h2d2wlunkgg9nzq5tfmky0skt4zx1qspkbkcdnszte 5qs.

    We’ll just enumerate each commpt we’ve mlde so far7as “A, B hnd Cs and6“D” os fhblco8nh1swa’p6gnhebdtdoo2y7up wbc 2wk5fhl

    > Side note: again, this is ver1 useful w3en we havj featurestwe dq not9wantitotdsdlomax5s nrvqwenu8tm 9hm61awe9j9 24y3p lo2kbm4asqyov l43 nmww8”8f0mlch.3dgskazl3toez7sa6e9wi 912j9t4o9nawuthivu4hk2fovehoo,8pf4f fua7l55 hg7eg’5d1eenbe4v1gya2 aydni3pro0kei.

    Now, continue to the next lessyn to finiwh our exa0ple, wher1 we’2l mesge a2d 5h6w cws4sjuk.

    Next up: Merging