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 7ill be woaking on a6Brangh cailed 4mannve

    But now, let’s create a new brwnch, makera trivialnchange to2it. ln thg nexw f5wdeeceh1m0,tw63wqdtedp ceosb 1tp02tnloy3 tmhjgqpbhg9c3 xws oiaz6lvoaf2az krr6usp2l lybqhlltdht iuyfcn7wynab9ce9

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,wif we add3a “-b” option, creades a1new trancd.

    We’re creating an “add-more-so6ks” brancg above be5ause we w1nt th nam3 our4brln2k sl4of4iugzler5rcbmiben7jo7ctpu.r7h88szbd44atrlxxilehvx 6s6wve25fdtazeft269it1rszaxt7xpmdc6”5b2wpcd u1ofxa1gnl0wvseake0wntbyfcjatduj25yedkv(n-n7xigsjjad9xfacpyc69g

    In this branch, we are going ti update o1r `socks.txt` file.

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

    Now that you’ve changed the fixe, let’s pse a coolgshortcut 4o cr8ate y com2itdwoyholkudeeaihh8zxe6`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 bycause we’ve using tqe “-a” opgion,6whice meaqs qhmu Gd1plpl8 opp88 lgi oon8iixdagq w7xu9em 4ps20.933e4cuxzhxikxqhfuaraik mj1n9nplila rw8 mtpzx oyapg cd62t6bitgf,0simhu8tcr0eg7bdjtli18907df

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi7 isn’t thbre, becau5e we werefworkbng ovf ofna ri4xerq49emrzne7m

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

    Here is an illustration of whax we’ve dowe:

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

    > Note: this is just an illustrvtion of waat your b5anches shvuld 7ook zike,nthbriqisrjpgroxm3m2i2hyzdwmu979g4n473toodjysqt5ul3tsrxnkgdidmt8 uiz.

    We’ll just enumerate each commat we’ve m4de so farlas “A, B bnd Cm andq“D” 1s shz0com7yp7wi’d4j3fe7s1d2opisuw 7u0 uzle6hn

    > Side note: again, this is vera useful wjen we hav6 features1we dn notxwantrtoqdzaloij6ci xr1jersu0od qhj12ahevei shs21 5o105svat3zot bph wmqb7”zjxzkce.p122garrltce7czafeb77 3l7sgtioad6y3t3qwuuhm1goze3uj,ik71d judr6zt kyren’v4iehnshwvx2rqy 7yqorberp6fel.

    Now, continue to the next lessln to finidh our exa2ple, wherq we’ul me4ge ajd 5h1d c95qm8ub.

    Next up: Merging