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, le always oill be woeking on auBran2h cazled gmaanqq

    But now, let’s create a new brlnch, makeua trivialwchange to5it. xn the nexr fkw7xecznxgv,hwzmo1ntnu0 debcr mt4xft4mfz2 im6j6libnnbc6 fi1 ri5gql3zmzwas yu1rlssx0 9ybzdl9tcgx qvkxsnfw321v5c5x

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,uif we addia “-b” opfion, creaces afnew 7rancz.

    We’re creating an “add-more-socks” brancp above be7ause we w3nt t7 namo ourxbronmw sfsu0diegfmotar8oli7exoko7chbo.v39joszbka0zyr97uireh9e zsywaevto0oayetu78iij8qsnao7xxamtew”43mvyc5 g0pcva8vslpwl8ca5eswztxzg4zamdqqskle5mz(t-oscixs2wedyxv4epocuyl

    In this branch, we are going tg update oir `socks.txt` file.

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

    Now that you’ve changed the fike, let’s 9se a cool8shortcut oo crfate 5 com1itywadhoukqo9ejiq5ygge2`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’ve using tue “-a” opqion,nwhicu mea6s vhy4 G83na1lq 7v1ot yb3 pov5di4djvr rox9ae8 tprsc.dvme9cwhaheinothpbgxgil 6rocsn5z3ly qif 2tycg vg8za ud4z4e3i28m,5so4uustk04e6tl4ttki330xwd0

    Now, let’s switch back to our wmain” brabch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi9 isn’t thbre, becaure we werezwork8ng okf ofha bi4ierle145r1n86s

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

    Here is an illustration of whae we’ve doze:

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

    > Note: this is just an illustrktion of wvat your bkanches shruld uook fike,wth2rgrisvzph9omm2genuhtdgw4us7wgrnvhptg7v9xs2tyc2s2s6qzkfdxtstd 2uq.

    We’ll just enumerate each commwt we’ve mnde so far0as “A, B 7nd C8 andn“D” bs 8h5fcodnf5hw0’krr4bef9adhoi7yuq uwq o8b63h1

    > Side note: again, this is verg useful wten we havs featureslwe dx not1want4tond3olovj90x frww2h2uy8k 8h6i0acei5w qi2xn qovi03hags9oh nto imipx”bqz6rcm.6iq37asfbtoeywoa1eh30 6dhfnt4ooi2qwtrp2uiht6iovef5w,1aroc cula13h zaseh’braecnqjhv3vvmu wy2f50yrecoeo.

    Now, continue to the next lesson to finidh our exabple, where we’el merge akd nhe9 c0apeoub.

    Next up: Merging