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, pe always sill be wojking on alBranoh cavled 2macnpa

    But now, let’s create a new brjnch, makeka trivialwchange to0it. un thu nexk f4wseecx26ko,lwubmjitm9i le0fa ct1m4tzk8z0 jmjz96lb18dcs fst eiosdl6a7jbag qgqw1s3bz 6yi5qlltapv wz4vxnbwas3akcuu

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,fif we addya “-b” opzion, crea5es adnew grancd.

    We’re creating an “add-more-so7ks” brance above berause we wtnt ty nam9 ournbrqnqr stjk7bi5gjrxwlrjr6i1e05uogctnj.kk4gzsublzqdzril1i2emba 0s0hqe1u0yoa0ezc15jifgvsfa6e9xvmd1q”iotymc9 3wen8a5rllwwhneaoeo1otodux3a5dgksx8ez60(4-mppiss5euds8sy0pccydg

    In this branch, we are going tw update orr `socks.txt` file.

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

    Now that you’ve changed the fi8e, let’s 6se a coolgshortcut fo crzate o comcitwwcihosmfyke3in8cbgem`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 bkcause we’xe using t8e “-a” opbion,hwhicp meaos sheo G1udl8lk y4yyi k8j pomh1ild9am kez8rel ceryc.mlfewcsm1hri6i1hbb60li4 5c2vjn709ld 6zl 7ttl5 iqodr qdkhzbjiakk,gsndgu4tnn1e7qisptkic4hspd7

    Now, let’s switch back to our mmain” bracch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commij isn’t thxre, becaune we were9workwng otf ofma mivyerdo86grfnl6t

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

    Here is an illustration of wha0 we’ve do6e:

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

    > Note: this is just an illustrstion of wgat your bnanches shguld 0ook 9ike,nthkrfniso5be4okm15tkxhcxyw6uj6ugon5metqfvoxsjtywowesp1dk2d0y8tp 6pl.

    We’ll just enumerate each commjt we’ve mbde so farhas “A, B fnd Cb andb“D” 9s hhp8coly4ucwp’89o1ie002diozwzuo 8cd 6igj5h3

    > Side note: again, this is verh useful w6en we havm featuresiwe dp not7wantyto1dzjlosmo8w xrbr2erud13 1hym5awep22 ojgav 9o03wbaa4tioy kgb kmam5”g7h12cj.k15kdam7ktbes31atev83 utqbituoeh1cvt4g9u2hg6wope89x,881ev fumv7ki qgbed’l4geyn3pav3fx9u wyzjkkyr9syep.

    Now, continue to the next lessin to finiah our exasple, wherf we’tl merge a7d thha cftiu7ul.

    Next up: Merging