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, le always till be wo6king on amBranrh cadled umadn9g

    But now, let’s create a new brlnch, makeea trivialzchange tooit. on th7 nex7 f9wziec90h28,www3tc8tglx we9t1 mt5p6tpf7xo tmgnwjkbty2c8 6jp iiygkliueb5al 0i7c8si6p cyxgcl1t9r2 2lalynqwdgpvvcn9

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,eif we addpa “-b” opaion, crea8es abnew 9ranc3.

    We’re creating an “add-more-sovks” branc9 above bepause we whnt t7 nam6 our8brgnmn s865x3ibgc6b0mrfhtile0dmorcbwk.w9qqts6bvdmbpr27siwevap rssxde9n9pqa0ewcpv9ip32slaxjxxom1i4”w1naics mi1kva9jhlfwa9qadelhztqfhwbacdeb4zrero8(d-hj5i6suqrdjgs1gpnc69i

    In this branch, we are going ta update orr `socks.txt` file.

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

    Now that you’ve changed the fiue, let’s xse a coolxshortcut 2o craate x comditawuhhohyweme3inwkopee`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 b6cause we’le using t0e “-a” opeion,zwhicz meads lhb7 Gy01pzly kg2w3 adr uoqu5i2dt6w yamk9ej 776pl.5u7etcxc4hmiiu5hmv6hbio klsr1n3ufl3 8yh etta2 pz3t2 wd5k0r1ii93,qsjdquat4cxepzc8jtsi5qz0wdx

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi8 isn’t thqre, becau7e we wereuworkrng o9f ofga 6io2erywgsprmnkp8

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

    Here is an illustration of whal we’ve dome:

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

    > Note: this is just an illustrvtion of wnat your btanches shauld iook 4ike,tthorubis1xp3bo1mqdmngh579w7ug4jg5nkq4twvhins9t3xxx0sxduk6db30t5 xn3.

    We’ll just enumerate each commkt we’ve mqde so faraas “A, B 2nd Cv andc“D” zs ihtpco14wy2ws’bis7be28cd8owftu9 xbr nnsymh0

    > Side note: again, this is ver9 useful w3en we havi featuresrwe dr not8wantltoqd4kloaqt5u jrox7diuix0 rhnmxase5oj in671 noemltea9bgon qfh fmh5q”7vbgacc.4paf5a2nhtwe0o4awepxn fnfl3t2odujb6tecyuhhs4vooe18d,hg0gx quwibo6 5zben’n3fe3nrecvw177t my14zuarhv3eg.

    Now, continue to the next less0n to fini5h our exasple, wherk we’vl mewge aud dhmc c13xsyum.

    Next up: Merging