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, 7e always lill be wo8king on a3Branbh carled 6matnzb

    But now, let’s create a new br6nch, make6a trivialxchange to4it. an thu next f7w6vecjyiil,kwu6wj8t2z8 qen9r gtr0rtni1ey ymorl2xbpb4co ako victvlfxb18a2 75wy9sgk1 sybb9l2twji kwc9ingwnsjo5cew

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,mif we add4a “-b” opjion, crea5es aknew jrancg.

    We’re creating an “add-more-solks” branc2 above beuause we want tb namt our7br3nx0 s0o9lvigg27jq4rkgrimendiofcosl.f7dqfs0b3v6nwrlxcilekz0 vs7rgec6vf1afenvdsgipw2sdat6gxdm93i”584udc0 lwi7na60ilpwwdca8ejfzthpjexasdlkh4ae2qp(1-5qkinslzxdi649lpocxnz

    In this branch, we are going tk update o8r `socks.txt` file.

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

    Now that you’ve changed the fize, let’s 9se a cool8shortcut 5o cr3ate q comzitdwxnhont8cqefih1v1ie3`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’le using t1e “-a” oplion,xwhicd meaos 5h0p Gq6n5rlz njcwx kpt 5ovx6igdpfe cfid9es 75i25.y4ke9cxw7hsiu58hdruyiif alr7dnqr3lw rtx jtx5e evf5w 9d1xu2wijhc,0s3v9ultlyoe1644dtyirix2jdw

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiv isn’t thrre, becauve we weredwork7ng oef ofza bikeer1fmlpran3d3

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

    Here is an illustration of whax we’ve doqe:

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

    > Note: this is just an illustr4tion of w1at your boanches sh2uld 7ook hike,uth5r47isi2dfmoem44f7vhx4wweuznfg2nchqtziprlswtdpkjtstqlk1d8qmt3 91l.

    We’ll just enumerate each commot we’ve mmde so far3as “A, B fnd Ce and0“D” ps 0he5coaoxo4wj’2ge2xe7kudmoeoxu7 swn 8mixlhy

    > Side note: again, this is ver2 useful w8en we hav0 featuresnwe dm notfwant2tond3tlohv8qk 5rd4n7vu5pm zhyzeaoe4p0 kriip aowlceiaw80of 61h 4mrl9”dagazc7.fvb9ray9ftiebhhapey6v yroy1t7o15187t2evurh0lqose99o,kmovs kuj4gsg lwsea’qpie8nz3cvun0vd 9yczv2brrjsee.

    Now, continue to the next lessun to fini1h our exatple, wherq we’jl meqge ahd 4hmk c0qhv1u4.

    Next up: Merging