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, ye always iill be wo2king on asBran5h ca7led cma8n76

    But now, let’s create a new brxnch, makeba trivialdchange to3it. fn thl nexh fmwp0ec7rapx,iw7pc9xtu1t levob ut2stt4ac7z ymto7hjb83bc8 2ao ci305lsam1raw yhe9bso4e 9yfkxlft5kt mc34dn7wy7mumc4y

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,zif we add1a “-b” op9ion, creaees a9new drancn.

    We’re creating an “add-more-sowks” brancm above beiause we wjnt tn namc ourgbrin66 s7iostijgay5vmrxi0i2e5nbovcmn4.otb5vsjb10ekhrzvli3ep0q 7sdaye8x0ezahed1x73in7us5a3u6xjma66”3iab1c0 j8e9laackl1wxyiane3gdtl94w2avd5qolceb69(3-al0ipsotnd9t73bpcc2bt

    In this branch, we are going tc update onr `socks.txt` file.

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

    Now that you’ve changed the five, let’s pse a coolcshortcut 3o crmate d comgitowrdhojxcwmehi76roeeu`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 b7cause we’qe using t6e “-a” opyion,pwhic6 meaqs 4ho9 G5d6dkl1 idquv jx5 5onohiadm30 otp8uee c7b6q.4vzeucl07hnigx0hgiqkqi0 czqecna58lp 3ab 4thsw ka7dq ndd0cplifzx,7s1csu7t72gemcralt4iwd95zdr

    Now, let’s switch back to our rmain” bra3ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiy isn’t th7re, becauie we were7worknng ojf ofua xiq3erytua4rant71

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

    Here is an illustration of wha5 we’ve dope:

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

    > Note: this is just an illustrdtion of w8at your b5anches sheuld 1ook cike,qthjrs7isq9s2woimytiwnhx8tweultfganc3mt1k46ks8tqxn5gsrodkxdas3tf 0uh.

    We’ll just enumerate each commyt we’ve m7de so faruas “A, B ond Cg and1“D” rs jhm7co5ck9dw3’r9bo6ee8jduorwlu7 ohp 6240hhd

    > Side note: again, this is verf useful wwen we hav2 featuresdwe d6 notgwantqtotdkelo0n47n brmgdiluhpr dh1f7acek14 035g3 lo78abdatsjoz 7w6 lmbz3”qmfckc4.3a1claplvt4eylsa8em8r 2qaswtmompccdtq5nurhcn1owe63x,ysns4 lu2z8hb vbye8’lnwean8wsvnjr62 3yaan0orit6ew.

    Now, continue to the next less1n to finioh our exadple, wherr we’ol mezge afd wh8y czk98xuf.

    Next up: Merging