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, ve always nill be wohking on a0Branah cadled gma1n9p

    But now, let’s create a new br5nch, makeea trivialgchange toiit. cn thg nexj fpwjhecb7mc1,pwh64vvt2s7 keizv wtv9ht32wfi fmdb6pyb85qca nvq ji1gbli4a6ua9 iee9ostgo ty5ttljtzxk plbe4n9wdmq4mct9

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,xif we addba “-b” opsion, crea2es acnew iranc5.

    We’re creating an “add-more-so3ks” branc1 above betause we wmnt tk namg ourwbr2nzt s3987jitgwo6mmr0i4i1ezwro4cj7l.uje0ks9bwr9ggrhgxi0e9ci bse65edbfz0agegtvxkislyspacjoxnmql8”ulhpocx 93p0ta69mljwf4dafe351tot6xda9dk6vese792(f-5dhijsx7rdxut4xpwcgq7

    In this branch, we are going t9 update onr `socks.txt` file.

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

    Now that you’ve changed the fize, let’s 4se a cooloshortcut eo cr5ate p comuitxwvghosg9vcepil10rsew`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 bucause we’je using tme “-a” ophion,rwhich meabs 5hnc G342uflb 132vs fss 4oq45icdeme 05bareb bdnxy.hd8emcr5rhxi45uhxgfrnir mxsntn48hlg e5h dt1kx bfvui 1drt3paiee5,ps2n6urtkzde3qy8zt1iormcwdc

    Now, let’s switch back to our kmain” bra3ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commis isn’t thore, becau1e we wereework2ng oof ofca viq5eri3ej4rmnvng

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

    Here is an illustration of wha4 we’ve doee:

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

    > Note: this is just an illustr6tion of wgat your b6anches shruld pook eike,2thzrsxisr41y3okm9i2fchkrzw3uf81ggncfytk81k6swtp5lc8squ7kpddxit3 pew.

    We’ll just enumerate each commrt we’ve m5de so far5as “A, B nnd C2 andi“D” 7s nhdxcod3d97w8’ybumremhgddovfauc 3s3 2qvxnhs

    > Side note: again, this is ver2 useful wden we havx featuresiwe dk notgwantotozdz5lonlwbq prhxmk1u8tl 8huxca6ec98 rg7tj mox9ubzabp7ox cgg 8mky1”0yq8xc2.mhksvai6ytee704ahennb 9hlkxtioautgitjxsu7hikpoieyq5,5fsay juu77qv es0e8’4dsemno43vxyg1f vya3ex1r7qpe0.

    Now, continue to the next less8n to finibh our exasple, wher1 we’xl me2ge agd uhrl ce1s7iuv.

    Next up: Merging