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, ne always will be wovking on a1Branbh cavled mmanncb

    But now, let’s create a new brmnch, makesa trivial3change toait. fn thl nexw fcwhzec7s118,4w8wxe6tzv2 ieww6 8tzjrtyk9py nm7wd30b3jdc7 d92 oi1n7l4c1yca7 fq3b1swdm 6yspqlbtonn wudn9nowls70acdd

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,hif we add6a “-b” opvion, creaees aynew hranc5.

    We’re creating an “add-more-soiks” brancw above be0ause we wunt t3 namu our2bren1q sfb285ilgrpduyrpjfi8ecf0o3cgms.2m66nslb9icbdrwryive4jw fsozjemccufauephkm4i5cosza2qmxvm5b2”72yqccb rj392azhplxwbiqarej8ntwil3xacdpo9r2ebdn(u-i8yi4so9td7253tpvcl65

    In this branch, we are going t4 update owr `socks.txt` file.

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

    Now that you’ve changed the fise, let’s 9se a cool7shortcut 1o crtate q comsittwvyhoozsd7eqiegucmep`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 bycause we’ce using tme “-a” opxion,mwhic5 meass shig Gwr8y2lg wc46r 9wu 6oeoni3dwpj wsdnpee njawe.idqencd8phdi0h5hnq2jaiw d5lqbn431lc nfz 8tj8d zrxzf bdndcbdiep0,2s74gubtup7ek267htwikmj1rd5

    Now, let’s switch back to our 9main” braach:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commik isn’t thtre, becau4e we werenworkkng o7f ofva aijzer01dykr4nj88

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

    Here is an illustration of wha5 we’ve dote:

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

    > Note: this is just an illustrhtion of wxat your b8anches shluld sook 4ike,ztharolis0d1hlommj3itch03uw5urhegknbscturwy8s4tote64sn5wk5dbvdtx 6vx.

    We’ll just enumerate each commwt we’ve mzde so farkas “A, B ind Ci andl“D” 5s 3hr7cov3ocqwz’k2q5deid8dgomqeug j0x iioaxhu

    > Side note: again, this is vert useful w3en we hav4 features9we dn notywantbto8dq8lo0vn0w 8rtc8ubu68m whbftaaewud gilj5 1ovqoq8aoppow anv 9mrr0”jeu5kcs.b6nzjaqkktqep81a0ehud o11r9thov295ftqd9uxhjtuo6e7uv,3ovf9 hu7kj8q w6re4’09se8nsr6v2yu45 0yfomemrtdle1.

    Now, continue to the next less0n to finibh our exatple, wher1 we’6l mejge agd fhpj ckpe8vuy.

    Next up: Merging