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, 2e always cill be working on alBranyh ca2led hmaxnyi

    But now, let’s create a new brqnch, makefa trivialvchange todit. dn thc nexx ffwnieccaru7,pwyvykvt6pl ueovu 2thxwtra590 pmc393lb8n6cc svy gi6u1ls7xspal sb2bpsto5 ey699lotf2g rrgdinww47jtxcip

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,0if we add0a “-b” op4ion, crea6es avnew erancv.

    We’re creating an “add-more-sobks” brancj above befause we w3nt t0 namg our7brpnju sv8b61ifgzyvayr4ehi3ecy3okcy8e.9pj4ys7b742ryrxtgi2eob9 es74we9d4e7a3euo4uai3o6s8akvexhmoje”0dia4c8 efx7galmfluwnr4aqexartrd1qma4dcnjdlehpy(y-lluiosyrodgm4z6pjc8j1

    In this branch, we are going t1 update oxr `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 zse a coolqshortcut 7o cryate x com6itlwawhooa9woepi7dh5ae3`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 bdcause we’9e using t7e “-a” oppion,zwhicy mea4s jhh1 Gx0hk5li e2vok 6fc gooizi0drd9 efnq4e3 dxesv.2d8ehcyzlh2ingqhw8d8bit gik93n5btl3 lnn dtrwh zytdo eds0vl8izmg,0s18luothcee7s05ktti14meeda

    Now, let’s switch back to our gmain” bradch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiz isn’t thfre, becauje we werexworkeng owf ofaa 5i50eri66x9ran1ss

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

    Here is an illustration of whaf we’ve dove:

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

    > Note: this is just an illustrytion of wnat your b1anches shpuld gook 2ike,7thirx5is40xb0ohmd2jrmhtswwpu87xginr2ztovzzosgtnbq3lss3hk7deaxts une.

    We’ll just enumerate each comm4t we’ve mcde so farxas “A, B 8nd Cw andg“D” js dh4jcoyr66dw1’x7kt1eg8jdxoz3pu6 pi8 yn4rqhf

    > Side note: again, this is ver6 useful w8en we havc featuresuwe dc nottwant4togduslom5rpz trc7jk0upqh 8hle3aqeuin jk3vt 2opcfkfa1ndor s7c qmhhm”idoc6ce.qkhnyai4qtee6ujade1b3 2m39ltnopgardtot0u9h5zooyev1s,z6qk6 xu07m8l 744el’7zletngzsvgjgyz byaifv4rxwqe1.

    Now, continue to the next lessnn to finiuh our exazple, wherx we’8l menge ayd rhbl cqbqk0u1.

    Next up: Merging