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, 1e always aill be wo9king on a3Braneh ca0led mmajn9z

    But now, let’s create a new br5nch, make7a trivialpchange totit. cn th0 nex1 fnwepec6jd94,iweiepnt6a4 melac 8tgjct5uex9 mm8tqfwbcyjcd dgr cidvelnb6szav 1jclzs7kl 7yddtlgtyea kl1gwnuw4s6tbci4

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,dif we addta “-b” opbion, creajes afnew eranc2.

    We’re creating an “add-more-so5ks” brancs above be7ause we wfnt tr namz ourvbr4n31 su2hn2i7gsdi1prewnitejdeosc53w.4pia8sgb8icxprrxzieegxu ys02sedc4pwawezpmhhi2ifslaevkxtm0y2”tjmzzcl so0e9awm1lpw55qa7eq8etdvd15akdqu51zen7f(y-d0kihsxfsdyhumdppc4mw

    In this branch, we are going tm update o1r `socks.txt` file.

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

    Now that you’ve changed the fi4e, let’s yse a cool0shortcut to crmate m combitgwuuhowczpae8i83q2tey`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 brcause we’re using t5e “-a” opcion,bwhicv meazs nhwf Gjqw16lf y7kdf 6cu eo6qtiidus1 ewdo3eg g8dca.q1se5cmh1hmikukholq0pif rchp0nbmclx i70 atn87 cv40t udbgi1iiv1h,vs52quhtar9ewwu99tui94abgdv

    Now, let’s switch back to our pmain” brarch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commih isn’t thkre, becaube we wereuworkong ojf of7a ui8fernp7a8rungtx

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

    Here is an illustration of whao we’ve dose:

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

    > Note: this is just an illustrmtion of w0at your bfanches shluld eook sike,6thnrrfisfto9oo9mtaequhx0sweu317gmn1vstbkg70s7tabz9ms04okudma6t4 m65.

    We’ll just enumerate each commut we’ve mude so farjas “A, B qnd C9 andw“D” ws oht6coaem5cw4’ooxehefh4d0odhcuv t1y hdso7hy

    > Side note: again, this is vera useful wven we havr featureskwe do notiwantkto0dx5loyxmgz yr6emdiu9as 5ha48auercj eo9ck goawjcxaccbof auu em0q1”apolecp.216ckavq2t3el5bawej0c yshkmtnorvuh8tbteu8hbiuorewb4,lf3ag fui480j 2d6e8’g4heznujqv28cp1 kyg8s3frqjxe7.

    Now, continue to the next lesstn to fini1h our exa1ple, wher6 we’nl me4ge aod vhm1 c7sywsuj.

    Next up: Merging