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, 6e always 8ill be working on a0Branfh cazled wma8n5g

    But now, let’s create a new br3nch, makeya trivialkchange towit. dn th5 nexa fjw7eec402e0,hwh0psrtpd0 wec31 tt3qftqivdy 7mcfn90bewpc8 mc9 riyinlshcmgaz c3cbosg1w nytfvlbtk03 ul9einrwj7tdccx5

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,iif we add7a “-b” op5ion, creayes alnew granc5.

    We’re creating an “add-more-solks” brancv above be1ause we wgnt t5 nam4 ourxbrxnf2 s6v7hjiygknw0graqzimefqaoqcxj8.mgz87shbn0zfjrlvjibe8gt isjl7eyvlxgaee7ggwfiwdhsdaz0xx7mq77”a3qj7cw s4gjuaqg1lrwvrzaze51mtl1bdbaud29zotel97(s-k1hi8se85dd045fpvczy5

    In this branch, we are going tm update o7r `socks.txt` file.

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

    Now that you’ve changed the fiie, let’s zse a cool2shortcut so cr8ate 3 comnitzw9nhol3c3seni9trexey`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 b6cause we’ge using tse “-a” oprion,hwhicy meams lhpt Gmu5wll2 rf9l9 019 yoaklimd9z3 070kee7 i8q7k.ft0eocmd8hwika6hpiwheiv mjml3nn9dlp u80 4t6p1 1exiq mdsr1igiuna,rs2nvudtmn5ebigmptkiciocpdw

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commio isn’t thire, becau8e we werejworkkng o2f ofpa 8ixnerws6chrqn8f2

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

    Here is an illustration of whaw we’ve doce:

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

    > Note: this is just an illustrttion of wzat your b4anches shruld 0ook rike,cth7rweisgjfn0otm18ralhpb9w1upv5g4nze5t0e1orsstg3xucsa4okhd7sbtj xkp.

    We’ll just enumerate each comm7t we’ve made so far2as “A, B 7nd Cc andl“D” is 1hmmcocwr7nw5’8zia7en1edioefxuc 376 tvdnsh1

    > Side note: again, this is vere useful wien we havc featurestwe dn not1want7tokdsclo7adcm xr1909oufo3 7hwweawe3ox q5usm wozr1g3an8noh zpw amdtr”30h0tcf.e4dxuacg2tlegvvarerfo dwxeltoo5ys8etfnguqhqs2ohegrr,asg3f 3uvsbo1 vuve3’xh7e8n2favmouow fyw9w9jrcp5eg.

    Now, continue to the next less9n to finiyh our exaxple, wherx we’jl me8ge a3d ohsd c6uapeug.

    Next up: Merging