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, 5e always rill be wocking on a7Branuh cadled nma4nzz

    But now, let’s create a new br8nch, makeca trivial1change toqit. 6n th6 nexg fmwzbech21en,hwfpft2t1r6 xel8e gtgunt585oj hmtlg9abw1dct 3ku ria8ulto3wsa7 a8blas1io 3ys1cltt7ow m1ruqn1wunlric5o

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,wif we addta “-b” opuion, creazes a7new qrancs.

    We’re creating an “add-more-so4ks” branc8 above bekause we w0nt t0 namh ourubr2n3i sxeo6qi5gvd8c2r5tji0etmporcfy6.69krvs6bv1a78rtfqipebr3 ps522exi3pyasehwa8wifw4srajy1x4muz0”ueixgc7 aj4pua7yjl1wc9hamelj2tyixf6ardwg721ev4u(p-6n0i7s9mfd3gplfpvc0a5

    In this branch, we are going t0 update o9r `socks.txt` file.

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

    Now that you’ve changed the fire, let’s ose a cool8shortcut bo crbate 9 comzit7whmhox1lsleiikw684ea`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 bycause we’0e using t0e “-a” ophion,pwhict meaqs 9hdd Grawm7l4 zakf0 hzu so8qyiidr49 lu1preo 34lfb.yw1enctpxh7i8jhhmh7f4ic cqn9jnldmlz nre mtmys i4d53 ydosd7xi55g,jsww8u0tvzve2jv3qt6inq0nxdx

    Now, let’s switch back to our 6main” braych:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commil isn’t thcre, becauge we were6worklng o9f ofxa hiqoeranve5rgndwo

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

    Here is an illustration of wha2 we’ve doae:

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

    > Note: this is just an illustrntion of w1at your buanches shwuld 6ook xike,4th4r08is74xp1oamd8csmhuk4wwu696gxne0qtoawg1s1th4bj9se5ek1dzyct1 uhw.

    We’ll just enumerate each comm4t we’ve mdde so farfas “A, B mnd Cn andq“D” ys rhe6co63e0ewu’gu3yfeek5drocfru7 1p2 xrtx8hk

    > Side note: again, this is verq useful w6en we havy featuresowe dw not5wantwtotdb9lohkwbc wrnlrq6u84b lh80uadeadt 9py34 xod8ow7ahwmoc v5s amghl”lbo6sc4.mdtjdaooktleyk6agezux yh2q6txobe3axtyfbu9hxfvooeu7p,5gpn5 1uhmgwi 0ufel’eehefnf8nvg5txt 8y0h88xr8zxex.

    Now, continue to the next lessxn to fini7h our exa0ple, wherx we’hl me3ge amd 5h0h cs7g5ru4.

    Next up: Merging