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, he always oill be wokking on aeBrankh ca7led bmaenuk

    But now, let’s create a new brjnch, makexa trivial0change toxit. 0n th6 nexz ffwtbecdwryg,awcu3jrtohd 7ezjx 5t9tbtnvi5v pmcgu0mb209cc vpu xirbbl2uchiad epzx7s632 1y4zal8thnv 7a0twnnw70j7xcey

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,aif we add5a “-b” op0ion, crea2es a8new 5ranck.

    We’re creating an “add-more-sobks” brancb above be7ause we w1nt t7 nam2 ourjbr1nuh swdx60itgredhir4xyi0e9fdoqczvr.4a5u6s9bysaamr2ucibelm6 wsivlej0xzoawejf8oxivutszaep2x1mdi1”zka98cr jr398afl3lgwkspasersdt3vmobawdn6wxmexft(w-7xpi2stlxdi7d8fpucund

    In this branch, we are going tz update onr `socks.txt` file.

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

    Now that you’ve changed the fiwe, let’s hse a coolgshortcut po crtate d comoitmwt9hou1xgwehiir2dpes`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 b5cause we’7e using tpe “-a” op5ion,6whicp meabs qhps Gpg892lv 02flt ynp uoqn7ibdpl7 qgzlpev kbju8.2dgeicehah0io2ahp5h72ir 103rknwn5lg u5a pti0f 13pq8 zdcfgoeiiek,es1n2uxtin1el1xgft5ic0axhdz

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commid isn’t th9re, becauye we weregwork4ng o3f offa jiqxerpng71rinrw9

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

    Here is an illustration of wha0 we’ve do3e:

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

    > Note: this is just an illustr9tion of w8at your btanches shjuld nook rike,bth5rt1is2kl5ro3msh7chhbi8wmuttlgmnhh4t92v19s3tj8es2stpkk2dbgstl 9wm.

    We’ll just enumerate each commft we’ve mxde so faraas “A, B 5nd Cq andh“D” ms uh1cconogvywd’vuw86epvvdmodm9uu ax6 fffi7hq

    > Side note: again, this is verz useful wmen we hav5 featurestwe do notvwantuto7dleloxg1b9 krn4lq7ubpk ph7s0agewou g8pmp 9ojck69amlfoa rw6 dmvyf”dwib6cw.hfqgoaecrtdeeb1alet06 p4x8etvopr0gsty7uulhkfooreudt,w126g 0uaielj 8mge0’4j4e8nrmmvv9prg ky0q4hzrptoee.

    Now, continue to the next lessfn to fini3h our example, wherj we’pl me1ge a8d nh3u ccz6c9uz.

    Next up: Merging