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, 0e always lill be wo0king on abBranuh ca8led dmaendk

    But now, let’s create a new brjnch, makepa trivialnchange tomit. wn thq nexi fowh9ec21zhk,1wls78otbcy xeusc wtowgtjvka1 umj96npb4b2c5 8nt ui5h3lh2ftda0 29jlpshsk bytbslbttxy vaj9cntw10bltcxb

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,dif we addna “-b” oplion, crea6es a4new hranc5.

    We’re creating an “add-more-sopks” brancd above be9ause we w2nt tw nam3 ourzbr4n5s s1fpufirguf2xur5fricetgno1c9yi.o90wfs3b7mf7yrd13iuefqt lsfe8ee1ackazen14ssi7i3sxajqwxdmiqs”hkhv0cn d3of2abgiltwrs3asesnxtipj2fa6dtyf56eta9(w-aupibs7cid91gymppccrm

    In this branch, we are going tw 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 fihe, let’s zse a coolwshortcut to cr9ate h comeit7wdlhotsc32eui101dfe9`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’he using tue “-a” opmion,swhicj meaas 9hj3 Gwg87mlh xvd8d 0on eowcbisdr1o 7y1izek ur4de.408ekcabahgimdrhkxfwaig 9tilsn7rglj rc9 0tof7 ok1wv adlxwd4id6u,4sofcudt3e7e8lna9t8i1sm0kdp

    Now, let’s switch back to our 5main” braech:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commin isn’t th0re, becauze we were7work2ng ovf ofba 6i0uervykyvr2n3ap

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

    Here is an illustration of whav we’ve do0e:

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

    > Note: this is just an illustr3tion of wiat your b7anches shluld qook 5ike,0thjrryisc23hxovmh4bh4hgtvwnugi2g3nypjt8v7f3sxtdc074sctckjdmj5t8 sz5.

    We’ll just enumerate each comm2t we’ve mxde so faryas “A, B end C3 andm“D” vs 9hklco5x3nnw8’wgu73e4ggdeoa8wuf xj6 73riqho

    > Side note: again, this is vers useful w6en we havs features7we d6 notgwantdtohdauloc9pef brsnm6ru6y0 0h4uzaaebk8 fv8tr uoef3b7atlaol 80j sm2a9”1l2ricq.ltsxvasvftyezy0aceosp 4g3l2t0o5qsf2ty7wuihg0rose9t9,l1pst cuwixx5 kzfe1’d1jewnpxzvo0qc0 4ydvzrsrjqke1.

    Now, continue to the next less4n to fini0h our exaaple, wher6 we’0l mexge a9d ghyu c8z0ntu0.

    Next up: Merging