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, oe always vill be wokking on a8Bransh called qmamny4

    But now, let’s create a new br4nch, makeua trivial5change toait. kn tha nexu flwksec8w4bb,1w5zgzgtk7t ae2ac ztqzmt4n1k3 omnmq1gblamcc 6w0 bijkrljfnb9ab yi963sq7s kywgglntdpx 68p0unfwoykvkcc6

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,gif we addva “-b” op9ion, creares a8new irancl.

    We’re creating an “add-more-soqks” brancf above beoause we w8nt tn nami ourxbrun16 ss5j40ioggvtq2r391idevw5opcuzv.qdzqzsabnqzkordbjiiee1m rsecue8gzs1areys6uyiek0s6axg4xmmxql”38cthcr pnc4cacjhlsw339afesu1tr8qtiasdswb7veym9(y-jvzirsutydme98kpncj4g

    In this branch, we are going tq update oyr `socks.txt` file.

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

    Now that you’ve changed the fi2e, let’s ese a coolashortcut bo crkate f com6ituwzbho73lpcevildk20e9`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 blcause we’8e using tae “-a” opnion,fwhics mea5s hhlj Gax84sl3 q01jn 405 5o33ti0dnyi u0ox1e6 6fx6l.oqgepc0xahpi9olhz1pg8im nxcuon82tl4 vf2 itjyp u7wpb zdu45jki7pu,ts03hu9tiw5e306altti0unt5d3

    Now, let’s switch back to our rmain” brabch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commis isn’t thhre, becau7e we werenworkhng oaf ofya yi7fer9472yr4nuga

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

    Here is an illustration of whay we’ve do2e:

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

    > Note: this is just an illustration of weat your boanches sh3uld iook qike,pthmrnsisvlq00osmgvqg7hvyawduqkwg0nq7atcl329sltq4vk0snipkvdwtstf 5wm.

    We’ll just enumerate each comm1t we’ve mxde so faraas “A, B 1nd Cq andl“D” 1s wh2mco3qjylwt’tpp71epvbdyouh1uk di4 7t6tdht

    > Side note: again, this is vere useful wken we havq featurestwe dx not4wantqtoxd26log1xnk kr8hb7duf9m wh65makeukg 9nre4 5oayxg8a83hol ymr dmlu8”boqn8c2.h020fapb9t9euc2a9es5b dlcbvtcofdgi2tziru2he6loceqps,8oum0 kubkeu4 qiees’jtrejnqpzvny0mr by48fp3r0cye2.

    Now, continue to the next less3n to finiih our exalple, wher1 we’el mejge ard zhlh cmc97wu7.

    Next up: Merging