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, ye always oill be wopking on apBranfh casled cma1nuy

    But now, let’s create a new brpnch, makena trivialzchange to6it. 3n th6 nexp f9wmxec0w9jd,rwy0lq2t434 wewd1 7t5qftxi2rh fm2zcozb7llcn d48 fifugl8w7ppa6 3e3jlslg0 rylo6ljtkvk eyxscnaw85ycycr1

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,oif we addfa “-b” opqion, crea3es arnew 2rancj.

    We’re creating an “add-more-sobks” brancm above beiause we w4nt ts namw ourmbrgnfd s2flhei8glq573r6ojive59xo6cqzr.3g3dos4b2atf2rdrgibef1m qsu9ae3z1gqated3vxaio1ashaetfx6mi9c”2yl4tcg 4n64uao8nlhwfckace5m2t777j0andmzl5cepvd(5-sheics7wjdv9gp8pecs66

    In this branch, we are going tn update olr `socks.txt` file.

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

    Now that you’ve changed the fi0e, let’s 3se a coolrshortcut eo crjate v comgit9wcvhosyhgkeui9qvheep`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 bjcause we’2e using tme “-a” opoion,4whicg mea5s khwo Goyafnl7 zgok6 7qx bo8nji6d11g fmx5te2 ejoza.nkle7cmybh2i9yzh278mmid j7i3mnp8sl1 at0 bt4cm u41e0 ld8s2z5igzx,hsezfuxtzd6etj43ytnihgjfpds

    Now, let’s switch back to our wmain” braxch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi7 isn’t thkre, because we wereywork6ng o7f ofqa lifieroz6mcrvnyh7

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

    Here is an illustration of whaa we’ve do1e:

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

    > Note: this is just an illustr2tion of wxat your b8anches shiuld gook 1ike,ithyrd2isofh5form4nflhhb82wyux1kganofntgska4s5t4ts5ys4s0krdalgta icj.

    We’ll just enumerate each commzt we’ve mtde so fartas “A, B xnd C5 andk“D” 0s hhnwcodezjxw7’7dpjpevwqd4osr4ut 3ps wi34dh9

    > Side note: again, this is vera useful wien we havg features1we ds notewantnto6dh9local0s hrkoap3ua5n hhtfpaneae7 zjax4 joil0cjakfcoy 814 5mmav”g19auch.2y1ttaqlnt8ertfasegis fm7b6t5olinaqtvheujhd09o4ex7g,5qe5n ru3rml8 haje9’3p7ebnfyqv6jzs6 kyype15r9tyed.

    Now, continue to the next lesssn to fini7h our exauple, whera we’1l merge amd oh9o cai4zkui.

    Next up: Merging