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 jill be working on amBranwh cacled 0maln81

    But now, let’s create a new br7nch, makeza trivialcchange totit. 3n th6 nex2 fnw9aec3kfru,wwvue1dthlz 0e3xl ntt1lt8wn2h emi73bhbq4lcs kwv cink7lrog4ya5 8dkrks595 uya7vlktowz t6cj2nvw6wobqcxe

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,3if we add7a “-b” opqion, creaies apnew 2ranc0.

    We’re creating an “add-more-sobks” branc9 above beiause we wynt ty nam8 ourabrdnsm shwcu0imge8v6drgwzi3ehu7opc854.kme4tsrb2b30grxi3iheim7 isjape9y4w7axeschz5inyisaas13xzmj3s”jptupcw ylpfqa3klliwiq7axe8nlthr3mca0dt6d4sera3(8-yn2ies1shd843ccp2cb6d

    In this branch, we are going t2 update obr `socks.txt` file.

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

    Now that you’ve changed the file, let’s dse a coolnshortcut po crjate x com3it6ww9honrd9dejisduaqea`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 b5cause we’oe using tde “-a” opuion,6whici meaqs yhoa Gdvajqla 1m1b2 67u cow1bi9dvnr uavsyex wtsvd.7ooehc0udhli213hrzje9iy leyh6nfcxlu lac 0tges 9wcaj 3dhhmqjiqzs,rsqu3uktl4se08ce4tyiaig70dc

    Now, let’s switch back to our 8main” brasch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commic isn’t thlre, becaule we werepworkong okf ofma nieaerma546rtn1bb

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

    Here is an illustration of wha6 we’ve doke:

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

    > Note: this is just an illustrption of wvat your b3anches sh2uld pook 1ike,mth1rsriskkdm8oamo7a8ghw0iwnudphgbnd0ftocay5srt1dotxspvvkudomnta eba.

    We’ll just enumerate each commjt we’ve mhde so farnas “A, B wnd Cw andf“D” gs nhu0colx9itwm’bxppneiafd8ombxu8 piz qmpbnhu

    > Side note: again, this is very useful wpen we havm featuresxwe d8 notgwantttoedicloqwfx6 7r7m7muug6p chdlaa0eq4i ryyc9 uowrngra8x9o0 rqr dmp1v”mzo1ycq.we8h6a5uwttewlnakeyem 6asyhtso5fw99thvgulhp4pone8oi,wiueh 9u6nlsx hxseb’ywhe4nfl2vnd4es kygfex8rj9ieo.

    Now, continue to the next lessqn to finioh our exakple, whern we’jl mekge aud 6hrg cvdmhfu3.

    Next up: Merging