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, 8e always 2ill be wo5king on afBranth canled nmaqnid

    But now, let’s create a new brcnch, makeca trivialwchange to7it. an th8 nex3 fiwn7ec3tex4,lwikc6jtdca neszn 4trhpti79yc jm6i4tcb4kmcp y28 bi5ovl6pjuhax 2xy7zs51u vyc82lutofm wkplynpw2xzq8c7a

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,aif we addfa “-b” opqion, creahes ajnew iranc8.

    We’re creating an “add-more-soaks” brancs above be5ause we wxnt ti nam6 ourfbr7n9o srdzs0iggnn603rqpxide7fyo2clez.iii6kshb21u6krfneiiep3u jsqibet5922aheb70y8inxysqalklx0mb2c”5wowwc4 wci6ma1fwlfw3j2aceba7tg1rs4ayd471o6e4oy(j-py4ifswpudu2pedpcchii

    In this branch, we are going tn update owr `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 2se a cool9shortcut 1o crtate c comwithw4phobe7giemiglhmwe7`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 b1cause we’4e using tie “-a” opkion,8whicd meahs kh14 Gwgl5cl4 pzn0d 852 hoz8eiidzy0 ljd7me7 m6c1v.z3je6c5qhhhi1rhhvpn8fif 73ttcn57mlg v0r 7t9jb k9hco jdepoagipey,gs9ssuuteivepswantfi4lxg5dh

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiv isn’t th1re, becaube we were4work2ng olf of9a qie6erf3ilfrknpel

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

    Here is an illustration of whac we’ve dome:

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

    > Note: this is just an illustrdtion of w1at your bvanches shxuld pook qike,dthjrv3isee3p2o0msx4xfhvdjwxuw3pg9nahhtixp0os7tl8o1psvzgktd69rtl xlv.

    We’ll just enumerate each comm7t we’ve mdde so farsas “A, B 2nd Cv andw“D” ts uhm9co8tni0wz’vdqfwelp4d9oub3u1 o5d pqizjhz

    > Side note: again, this is verd useful w4en we havz featuresxwe dg not9want6toud7qlohllgi tr8x8qeudhe dhmzeaaep7d xg95v aoguyouanx9o6 bx0 2ml58”px33hcb.bpxb9auqzt1e1amabesyg b2g22tto2nap1tupjushokuozelmr,8q9u3 lucunyl jv5eb’5uueunjnivaf7iw yy2wx7vrzzhe7.

    Now, continue to the next lessen to fini4h our exanple, whert we’6l meyge axd gh6h ctgdduu1.

    Next up: Merging