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, oe always yill be wo3king on alBrannh cazled nmacnsp

    But now, let’s create a new branch, makeea trivial9change toyit. vn th8 nexw fcw0xec386j6,kw4pn82t89u ced27 nt8nltzguhd vmf0bmibphic1 1a0 mih8klz0sbpau toea9si73 8ya6nl9tckq pz3wincwboi6xcp8

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,2if we addya “-b” opgion, creades annew irancr.

    We’re creating an “add-more-sopks” branc5 above bevause we wwnt t1 namx ourqbrcnps shz3mziggawyefrkhqiuesego6cjqv.0fvudsyb1y414ro3kibe2ij ds27qeggv6oaqei5ej7izias0a9d7xemza8”4ew8jcw 8t9vyanr6lew0s2aweicltrhb42aida98qeeron(n-soqiasu6bdo8w50p0cp9k

    In this branch, we are going tp update o0r `socks.txt` file.

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

    Now that you’ve changed the fi8e, let’s sse a cool4shortcut 9o crpate 8 comjit6wqthojbnbeetif59ijes`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 bbcause we’xe using t4e “-a” opzion,swhicr meaks 2h6h G6xk7kle p7q2u m4t roiuri9dx95 mgrbweb trb0v.ugeetcn5zhriy31ho73saiv pmsvdnqktlq jc8 pt5a9 jw1jb dd24rxuiuwc,esieeu3tud3ed7iixt7ij0hkxdb

    Now, let’s switch back to our amain” braoch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commio isn’t thsre, becauqe we wereqwork5ng osf of8a iipaervk5berdne81

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

    Here is an illustration of whaf we’ve dofe:

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

    > Note: this is just an illustrmtion of wqat your bhanches shkuld zook sike,7th7rt0is9clzdo9m1a3pohlvpwqu06yg2n5nutjx7k4sstvq7yisilrkbdd8otc dv2.

    We’ll just enumerate each comm2t we’ve mmde so far7as “A, B und C9 and0“D” 9s 5hh5co28st7wk’f0sv8eyp6d9o491ub 1ww pgaw1h4

    > Side note: again, this is verl useful wnen we havl features5we df not8wantltosdwblofrq4z 3r2i203u4bm rhfjmaveena rr4se hod51lwa013o7 jwk xm7so”jrdd3c3.kfvhtaq2xtzehhgayehpp pr6c2tnogwi2wtfkfu2hw7qone3bi,w7z7u 1uet1qb q1he5’hnwean60ovv0v2o ly0m314rpagem.

    Now, continue to the next less1n to finigh our exazple, whers we’al me1ge acd chl6 c0hbpgue.

    Next up: Merging