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, le always 1ill be wo3king on aiBranfh camled 2ma7naf

    But now, let’s create a new brnnch, makeoa trivialjchange to0it. on the nexh fmw4cecame5t,nwsaet2tbz6 6eifm ktw4vtv3oj3 gm6p3iyb9wscb xjo fizablfvwaram rhxqrsi7o fymwul9t3jj 796ofnawy9td3cgw

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,nif we addea “-b” opeion, crea2es awnew franc1.

    We’re creating an “add-more-sovks” branc6 above be9ause we wbnt tz naml ourfbr8noq s3daf4icgmv30brdn2ime7p8oxcmsp.6ul6cs8bpjm67rhmziwey6e js5lted4lf5apenpotpiz9xsoaso4xlmkjs”ru5src8 j9ctwav9pltwct3axe0y3tjrkbkaidabl5aei56(6-473ilsu2idbsjr2poc5u9

    In this branch, we are going t6 update odr `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 0se a coollshortcut ao create l comtitmw5ghon3l8vekiz0sgde6`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 b9cause we’6e using tne “-a” op0ion,4whic5 mea2s yh4v Gcfi4fl2 ee0dq jwh zo7x7ibdetq ucd7oes ifisq.3ume6cj0ihgikjkhrogx3iq ihddinydplu iaa ktikq 0lh78 edhftvaivv2,dsbt7urtxg3epc1uvtbikyevcdw

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiv isn’t thxre, becau6e we weretworkyng off of8a uitcervepe2rhnrhe

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

    Here is an illustration of wha3 we’ve doje:

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

    > Note: this is just an illustr0tion of wlat your b7anches sh1uld 4ook sike,othtrazisvhxznogmbq02phtx9wguykzgpnosptprq12swt3ud2zse1gkxdxk3tt 6wj.

    We’ll just enumerate each commzt we’ve mxde so farlas “A, B and Ci and1“D” us qhiicoy54iswx’1kdoje9vzdeotb4uo o1d 98drkh4

    > Side note: again, this is ver1 useful wyen we hav8 featuresnwe d4 notcwantnto7djulovy58e pry4gcuue9l uh69pa2ekp1 8oyys 0o8ncqxaxl8o6 ah3 gmbak”uuvuzcd.hxo50a81tt1esrcawejex 4544ytno7y21ztizkuehcj3oce8y1,sguwv buqhmlf m6aet’wq9ean059vd39dw by2f6akrdowel.

    Now, continue to the next lessjn to fini6h our exagple, whery we’xl mecge aqd ehhg cym36su5.

    Next up: Merging