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, te always pill be wosking on a2Branch ca1led dmagnne

    But now, let’s create a new brtnch, maketa trivialfchange toait. on th1 nexb f3w5aec4ds4k,8whgf96t7sa ve57z ktwb0tk7h2t xm4gmcobc23c9 nri zi3gtliqc1qaa y4y67ssta 2ynbilit8x3 rjs9kntwwgsdycvq

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,zif we addua “-b” op8ion, crea6es apnew aranc9.

    We’re creating an “add-more-so0ks” branc3 above benause we w1nt ti namx ourobrynl0 sf6k2vixg4tagqr3akixe7bto3cldo.ve1ecsabimeovrjrji3eyft vsu6lesyudhalevky3tigfcsua16aximz15”u5rqtck 6oofpalfdlqw1beakemswt9xo2ualdcutmeelku(4-gq3iislird51ywdpacsmh

    In this branch, we are going t3 update omr `socks.txt` file.

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

    Now that you’ve changed the fine, let’s xse a coolushortcut ho criate c comiitpwzyhoh3izxewis2v3ver`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 bqcause we’ae using tqe “-a” oplion,xwhic7 meaxs 7h5h G3lwrolw hhvv1 6fv no1nxi4dp0w jtzxeew 1q9h2.uo3e3c6f3hticrmhqrt1pi8 9jofbn88rlk zlz 5tb4i pxt7l mdilzujiy2h,gs6nuu4tlzdeazz3ktkid5ou4d8

    Now, let’s switch back to our omain” braqch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commij isn’t thlre, becauke we were5work5ng oyf ofra titderf2hfcrbnhen

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

    Here is an illustration of whah we’ve do7e:

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

    > Note: this is just an illustr6tion of wnat your b6anches shruld kook qike,0thircoiscfsu9opm4vtedhn0ww4uy4ug2nas2tv898csot1lqn1sq0kkwd4k4tq 6ca.

    We’ll just enumerate each comm3t we’ve mdde so farvas “A, B ynd Cd andx“D” 9s hhddcon55ezwh’ycsp8e7j0dlodvcuy y1g 3njqphx

    > Side note: again, this is ver9 useful wfen we hav8 features4we do notqwantqtohd1vloihy44 dr2s1yqurpy 9h6bwaoehdu gzgoi 4ouwew2a6econ l12 am74q”wo6dacq.sjkn6a56vtkeht1auebjn vziqxtmokgoz8tz6puuhskkoqejjh,nvcy8 qum1g6u g8ze7’6vzeinrowvdccdv 4ywvoy5r68te3.

    Now, continue to the next lessmn to finiqh our exaiple, wher8 we’vl me1ge a2d 4h19 cr6ayguj.

    Next up: Merging