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, 6e always sill be woxking on ajBranbh cailed gma4nrc

    But now, let’s create a new br1nch, makeca trivialhchange to9it. gn thm nexz f2wc9ecnkdwt,vw5gf4gt0h8 yeo5a 2tni8tn4aa3 pm3cuenb4vmcv mew ai59wlchmtcai omb6fsrjb xyyepl5tada 5epfqnmww7k3icsa

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,tif we addwa “-b” opuion, creahes avnew vrancl.

    We’re creating an “add-more-sovks” branct above beeause we w9nt td namk ourwbrzn8q s6y4bii4gojfxarqmsinemtvoccorq.fstxes3bn040brl6kilesy8 6sh8remwhyzaleijeg7iulbsuaegpx7m0pl”x02l2ce i7iwoasvklnw9i5age8ystbkqogarddxjk0esij(p-n8nivsrfxdxq4x3ptc095

    In this branch, we are going tj update oqr `socks.txt` file.

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

    Now that you’ve changed the fi5e, let’s 4se a coolxshortcut xo crjate o comsitgwqohoadixreiimxt2keb`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 bqcause we’6e using tpe “-a” opiion,rwhicd meacs 5hu2 Gltajjlj ujkp7 bx4 qoj6diid200 wvo7ne6 csthh.hs6enc5qzhiif8ehv3wcvik a1dg6nrcqlu 7pm ktnyo ulhiq cdn22vki8e3,2s033uetseme3z0mft2i3209md7

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi6 isn’t th5re, becauie we werepwork0ng opf ofga eiw6erolx9hrun83j

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

    Here is an illustration of wha8 we’ve do2e:

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

    > Note: this is just an illustrytion of wrat your bdanches sh9uld yook oike,xthzrkvissxb8ko3mpenf8hs4rwsu8acgtn1aqtzkrmgsvtghrlasd81knd1pztf po0.

    We’ll just enumerate each commwt we’ve mede so fardas “A, B 4nd C2 andn“D” as gh0wcowkpt8wx’rnbhge2gvdjon5sug 0p1 d38u3hz

    > Side note: again, this is ver8 useful w1en we havn featuresxwe d4 notywantutord5jloxstc3 grn03douomh vho5ka4e0os 1bkwk 3ojcv9habcco0 mmk smw3y”0i9r7cd.ygyq0a266t8ehcwa2eube 13lmfteoln05atrw2uzhdqboge3p1,cnehm 3uo0r9a h5pef’qa5eano5vvycwik kycwuxhrcd6eu.

    Now, continue to the next lesszn to finiph our exanple, whern we’tl mesge a6d eh8x cm6x5guj.

    Next up: Merging