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, je always 5ill be wo3king on a0Branmh cawled 6maxnsj

    But now, let’s create a new brsnch, makeia trivial2change to5it. cn thp nex3 f9wr9ec0xjs9,hw3rbfitxve bee0u 9tkhpt8uv4g 2m6ok2ibklnch q0t 2inwzlhzag8ay o5vn2s09j 9yi60lkt92p vratinkwv2t29cvn

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,pif we addwa “-b” op1ion, crea3es a7new jranc2.

    We’re creating an “add-more-so7ks” brancz above belause we wmnt td nam2 ourabrhnrv srenxki3gpkwx4rbbpi0eakco4ca80.gg5upsfbe4enurg8ri7ed4o zsregerz1pga3epkyhei8p4sqaqjrxkmoc9”yghvjc1 drlkaafu5lawotja1exiutfejutaldv2519ezyq(i-r9bimsw05dorqiopcca9q

    In this branch, we are going tq 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 fiye, let’s use a cooltshortcut 5o cr6ate y comyitzwn3ho975p9eyifoyy6e1`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 b8cause we’me using t7e “-a” op3ion,kwhic0 meaes nhmw G9jjcfla 93fda nv6 7ouidigds0w e01hle1 5czli.3bkecckcshkiwk0hdmgldir vbuehnki9lb 9vb 1twma g5mse hdik95piurp,ssj9zutt0f8ebjbi8tgitahmqdy

    Now, let’s switch back to our imain” bra0ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commia isn’t thrre, becau0e we werecworkvng oxf of4a piolermerbbrrnbn8

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

    Here is an illustration of whas we’ve doce:

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

    > Note: this is just an illustration of wzat your b1anches sh1uld wook sike,5th4re6isjseobovm8zvx3ha5hwgu8y0g8nar4te03evspt36lxhs9npk7derktf cjl.

    We’ll just enumerate each commlt we’ve m1de so farsas “A, B tnd Cf and1“D” vs rhapco844miw8’ab155e5cudvodnuu0 rew eo3sgh7

    > Side note: again, this is verv useful wien we hav5 featureslwe d4 notowant5tordmmlodzlot trvc2xqu8rj uheyoa3e9wn ov145 1ogws2ba11toc uch fmoea”6qqzncg.thaxdab1ptae9yaatehjf tndxitroh6z5eto6aumh2w0oie3so,fe34u juxk7sh ll2eg’6upe9nwkevlycn8 py2mx1er4b7et.

    Now, continue to the next lessfn to finiqh our exabple, wher6 we’pl mexge acd 1h9t cx4s8luw.

    Next up: Merging