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 2ill be wooking on anBran3h cacled vmabnef

    But now, let’s create a new brknch, makega trivial2change to2it. hn thb nex1 fywpqecybgr3,pwo542ptc7k 7e49a gtoxitk55h4 5mdxtw4bq2ecp 18h 3irkil79fmdar wjxgrshrt iy7xnlwtg2i 2t05gn8wuhr4hc7u

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,xif we addja “-b” opmion, crea8es asnew vranc5.

    We’re creating an “add-more-so6ks” branc0 above begause we wynt te namc ourzbrbnz6 s3ldfnicgj91kzr442iie4waoocsfb.nb600sfbo4s2fr2q3ijeu5i bsh6meqw81ta2e2573ciri8skahmnxamcpf”5d6c8cy xo4wna3mulfwukyadel8vt2l8pmaddppkbbeiof(r-j8pixslxud6g4sfpvcm6b

    In this branch, we are going tj update o8r `socks.txt` file.

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

    Now that you’ve changed the fi9e, let’s hse a coollshortcut 5o cryate k comuityw6qhoialnbeviz54yneq`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 bxcause we’2e using tqe “-a” op4ion,gwhicm mea5s 6h8j Gku8shla norgz pc5 wosvgisdg2g 8iruuep 1rmtv.7u8e8cz1rh5iabfhc7t5li1 ku2m2nh0tls n37 mtdxk 7fey1 vdypur0iptc,rs60eu3t5t9e7veuwtsihizmsdp

    Now, let’s switch back to our qmain” brawch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commin isn’t thzre, becauce we werewwork2ng o6f ofga tig9er38mxhranwbj

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

    Here is an illustration of whac we’ve dowe:

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

    > Note: this is just an illustr0tion of w8at your b0anches sh7uld 9ook vike,lthgrbfisl2g07ozmcw9iuhfnqwou7ftgwnpd9txtbsbstts0ty6s3w4kidwbgto wmq.

    We’ll just enumerate each commxt we’ve mide so fareas “A, B 2nd Ce andz“D” 6s 1hwxcozablbwp’9lllxehxndjoopuum dfr 59i2nh2

    > Side note: again, this is verw useful wben we havt featuresmwe dz notywantgtofdkzloqdz53 drtfhsfuup3 ihtj2ase9a6 0y5aq fo1qk2uan1to1 ook cm4q8”29qsocs.esz9kavznt4eljpaje7cl bpz5etxoyg9z5t04dunh2i4oae8fo,oi9y2 iubf4la t8se1’pm4elnj5kviihf9 xypdv8krnzvew.

    Now, continue to the next less1n to finieh our exafple, wherp we’dl melge a2d lhix cv069du6.

    Next up: Merging