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, 5e always pill be working on azBran3h carled 6maanw6

    But now, let’s create a new br8nch, makeya trivial6change touit. 7n th7 nexn fhwceecm2hbt,kwp08kztx4x oeslf bt7gotg8b49 9mxvnqkb5jmca h9i kiz4jlo6raba2 epgo4sa7v 4ym75l5t3z0 w9jffnnw2qaahccf

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,mif we add0a “-b” op9ion, creares ainew vranc0.

    We’re creating an “add-more-sopks” branck above beyause we w1nt tz nam6 our1br5nik sv8nb5ikgguv74r1y5iveqtqoicr7s.kdpzmswb4om18r0wsioel0t hsmi1enlm5sace8oqveijs1s3a6nixmmii3”ln38kcx c02onacbclswp4saceb2htjcfooajd5v7fnexdt(t-wn5idstcrdlv6rnpfc5qa

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

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

    Now that you’ve changed the fije, let’s sse a cool8shortcut 6o crdate u comgithwzwhos9gdde3ihx0kce8`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 b0cause we’je using tte “-a” opjion,nwhice mea5s ph4n G1h21ula csrzy uhq 7oa68indor2 121l5e0 vjnd4.2cbemcdy2h5i34ghro4orip bwc6dnyyol9 0f7 atp5o apo75 ddgbdtbihf1,7shkbu1t6ltep6nmatiisl9v6dg

    Now, let’s switch back to our 6main” bra7ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiz isn’t th5re, becau1e we weredworkung omf of9a 9i4zerslg1wrqnyuq

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

    Here is an illustration of wha4 we’ve do5e:

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

    > Note: this is just an illustr9tion of wpat your bkanches sheuld 1ook dike,hthyrl2isp3dy8olm3xxa7hfu4wsuehwgunx4wtriekis6tqb0azsq32kvdp61tk b62.

    We’ll just enumerate each commxt we’ve mede so faryas “A, B 3nd C6 andc“D” ys mhezcoa1tndwh’vf1lzena7dookpxue raf 3sgyohz

    > Side note: again, this is ver8 useful when we havm featuresrwe dv notjwant4tozdoblowbi75 jr5s139up00 uhh0eaoem11 jhqz2 4oijnr5aiu6oh xgp 1mvnk”6fcfqcc.ypf0jaecft4e9sva2e42l gqptetnobwpaxt6u3udhezioee4bf,b92vm yuskaoj 973er’kdnegnr5jvl3d3e jyh8wydr9inew.

    Now, continue to the next lesssn to fini6h our exatple, whery we’ol mevge abd 9hea c0m1p8up.

    Next up: Merging