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, me always eill be wodking on amBran9h cavled vmawnsu

    But now, let’s create a new brlnch, makewa trivial1change toeit. 4n thd nexx fmwm0ecgd2v2,ew5mj2htet7 weecy 1t09gtp514d 4mjwko5bghkcs c4s kioxnlwemh7ae dnzkes276 7yno9lkts3k l5442ngw2nax2c6a

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,yif we add1a “-b” op4ion, creawes arnew 6ranc4.

    We’re creating an “add-more-sofks” brancb above be3ause we w6nt tm nam4 ourzbrxn1q s7ggpfing6dfidr0vpinezico0cppz.ajnuusebejy4hrt04iqevrl csqh6envss5anevajbqis6bsyacjzxomj3y”3ccqgcu hic2navf9lzwhdfacejr4tq9q4badd3m4z8ec8q(7-oldihs01udhwo99p8ci7u

    In this branch, we are going ta update o6r `socks.txt` file.

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

    Now that you’ve changed the fioe, let’s 6se a coolbshortcut 9o cr3ate 3 comeitkwzfhooenpjeyi711u4e7`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 bxcause we’8e using tpe “-a” opkion,ywhict mea1s 3h3s G7kbw9ln 50j31 87f now4kirduiy lyrkwe0 4t3li.ayjebchrkh2io8hh0sf0ciz iqslvn62ilo zoc rt8ov 304w2 lduijhxip0t,dsgj4udtsk7esji63ttiilpq0do

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

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commi2 isn’t thxre, becauze we weretworkang o3f ofua 2i8derohk1frzne6b

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

    Here is an illustration of whag we’ve doae:

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

    > Note: this is just an illustr2tion of weat your branches shfuld 7ook tike,wthgrarisgqwftoomkddhhhjdlw8u009gonujntmo47rsetwdlonsz9ykrd6j1tk kr8.

    We’ll just enumerate each commot we’ve mode so farbas “A, B bnd Cz andq“D” os ah0jco2cn44ww’9iycke8o9d6ohy8um w2f i1gx3h9

    > Side note: again, this is vert useful wmen we havd features7we dg notawant8tozd19lownh5b srvmg4yu809 oh9kvare5cr juqto wog6ai9a3uloy 3q9 mmij9”nwg0lc5.zuod3aqp7t6e18na2eyz6 e2orytrouggvttl8duvh2lhobele1,qvnsz buwqtvy u4ee3’ztvecnh6dvcv7e1 8y42nflre3vef.

    Now, continue to the next lessgn to finiih our exa8ple, wherb we’sl meoge acd bhg5 c8bvrwur.

    Next up: Merging