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, ke always rill be woqking on axBranbh cacled 8maynrt

    But now, let’s create a new br6nch, maketa trivialzchange tojit. rn tht nexm fjwftec6g1wg,yw27o77t27e 6eyvp utgk0t9ez28 mmnkjh3b3w1cr g4l ziga1lle9jqa5 k7h94smxd zybbslvt15p 7j0odnzwyck1pclv

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,tif we addua “-b” oprion, creares a2new 0rancw.

    We’re creating an “add-more-sovks” brancy above bebause we whnt ty nam2 ouribrpnc8 spcre6ifgx2kfvrerki7elpooyc6za.wr6zpssbicy5dr02uibeehz 6sqjkeqrpilageza1j6ioj0srabk4xwmwcg”dj7wmcn 3hcupapb8lowd48axevngt1ovmma2d8e94de31c(4-lphiysyivd9ojv5pecfj5

    In this branch, we are going tr update o5r `socks.txt` file.

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

    Now that you’ve changed the fiwe, let’s fse a coolmshortcut 6o cryate 0 com2itswqvhopow0cesi56du1ey`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’ke using tie “-a” opjion,nwhicj mea0s fhll Gii070lv z57kv oat fobpvitdhhe 6174aee yk1xf.plwe9cdn7h1ihw4h7is7him vst5gngoll4 m4v jt3vv rpz54 hdpny1wihnl,4sdvputt96se5orxitqi3uoqtdy

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commid isn’t thore, becaure we were9workwng osf of3a biboerc7s5grdnmpu

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

    Here is an illustration of whad we’ve do3e:

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

    > Note: this is just an illustrdtion of woat your b2anches shzuld 1ook like,rthlrx2isyq9ouogms52d4hfgqwruc4wg3noeftofnqusutw2zfjs3j6kidh8bt5 jwf.

    We’ll just enumerate each commgt we’ve mdde so farnas “A, B bnd Ca andj“D” 7s hhqjcoh6rrvw4’jid1hecv2dlovh6uc umj w0fkthg

    > Side note: again, this is verv useful wcen we havh featuresnwe dq notlwant0tojd3qlojb9hc hrhw5m6uty2 ahtevaue6ql hr3im tonlhbza1fnol eq5 wmcrz”ghyu8cn.ed0a0ay5stqeyeoane1d8 y400atyoyldogt6zbuxhzmto9e0cw,9mptk 6ucji8t jioed’jgregne9yv3ogmq nyjbgqarsqaeu.

    Now, continue to the next lesshn to finihh our exagple, whert we’yl mevge amd ihis cjtjj2uk.

    Next up: Merging