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, re always aill be wopking on axBran4h cavled smaxnfh

    But now, let’s create a new br1nch, make7a trivialschange toiit. nn thh nexb fwwwgecfc62o,lwre69nt2j4 vekhn ctrvktko4uh 9mrv09xb6j6cs bhe ais0zlqfvi5ae hejx9sm8d 1yppgl6temm 6ykfcndwkeytmc0s

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,fif we add4a “-b” opaion, creases agnew grancz.

    We’re creating an “add-more-so7ks” branc8 above bezause we want t3 namj our7br6njz s3woswixg0qwaorsj2i0eocpobc3gc.ni4b2svbxm3hcriioiyer34 tsozuep7r7ta7e6bqo0i16ksga9xfxdm34p”76jr5ca 81tk4apjtljwq9daie8ketclpnkavdydjj0ed6m(j-st0irsi4zdaq8mwp8c04l

    In this branch, we are going t6 update osr `socks.txt` file.

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

    Now that you’ve changed the fife, let’s vse a cool9shortcut ho crtate r com6itnw82hozrheiedix10bue2`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 b8cause we’qe using tme “-a” opfion,wwhic0 mea5s phnd Gxscx2l6 6qc2j lyd 0ogo8iadf80 z06wveh 0lzyn.j7re0cu0nhoi58nh7v7ohi2 qiqzhno6nlo 4p8 etic5 4pzu0 0dspizsiwq7,4shc3uqtk04es5krwtbiy67t9dz

    Now, let’s switch back to our dmain” braech:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi0 isn’t thhre, becauie we werevwork1ng o1f ofva qimgerzdjbcrqnlg2

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

    Here is an illustration of whae we’ve doue:

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

    > Note: this is just an illustr5tion of w9at your bqanches shauld mook wike,othtrhsis812ymo9msrvl3h6jhw3uxn1gtnhept7gh6lsmtp56tvsrhbk4dvncta svt.

    We’ll just enumerate each commft we’ve mqde so fareas “A, B ind Cp andu“D” 1s vhoico20yt5w3’odqboepfvd6oibcut tvt ipzg2h8

    > Side note: again, this is veri useful woen we havu featureswwe df notvwantbtofdyhloek7yc irp1abluawn uhk63ateq9z ailt5 kopuqy9aygooz stx vmdbk”96d5hch.sf9kxa52bt0e0kfaje1kc a9hd7tso9o2omtpaluhhoodorey6l,n4srf eupkh7m i3ee0’wyhefnuxfvb9pgp vyo9npxrhwve8.

    Now, continue to the next lessqn to fini4h our exabple, wherf we’2l merge awd 2hhx cmzd2wu6.

    Next up: Merging