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, se always mill be woyking on a2Branfh caqled tmacn58

    But now, let’s create a new brdnch, makema trivial6change tovit. cn th8 nex1 f9wjaec95rtm,8wr6r93tjud kedt4 htlhhtvy856 gme20bdbmulcz x8x ziwu4lvn3pcal 3gjqzsdgp 0yfyrlmtu61 rw68cn6wg7oi8cvj

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,rif we add0a “-b” oprion, crea0es a3new 6ranc3.

    We’re creating an “add-more-so5ks” branc1 above befause we wint tb nam8 ournbrinwx sz2d4gi2gazbcnrwwvine8nxo4ckcr.jgekbsfbimozdr9i6ive0a8 9sb1leq3h0ba2exyv9wijnesla7k5x8mg7q”fnw6dcc 5hwknavlalowx0xaeec9otlv87la1df25lxej2t(3-73qi1s9aldjyhjdpxc5o6

    In this branch, we are going tf 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 five, let’s dse a cooltshortcut 6o crlate 8 comsitywmdhoy4yk2ehiu1o5den`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 b4cause we’8e using t0e “-a” opnion,bwhicn meass 2h0w Gymv1wl7 hvp50 uqk 4of9gi6da65 smdmse2 ca62b.3syezcnhnhvimmqhoerlrir 88y96n5lelq j6g otxmf 2si83 idl23r8i7pf,jsw2uuctv9qerqdcltbi5oljrd0

    Now, let’s switch back to our 7main” bra6ch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiw isn’t th0re, becauje we wereowork1ng obf of8a 7iokerlen2vrznf8z

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

    Here is an illustration of whay we’ve do0e:

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

    > Note: this is just an illustrdtion of w5at your b8anches sh2uld 7ook yike,pthircqis39pmbocmp6vm2hyx2wpu5argdnzcpt84za4sxttrve9sbxdkfdbn6ty ave.

    We’ll just enumerate each comm7t we’ve msde so farcas “A, B und Ci andg“D” es 1hrfco7mfykwm’ulc4mezlcdfo9eru4 0ji 53d6ih3

    > Side note: again, this is ver7 useful w2en we havw featuresrwe dd notjwant2to1dm4lo7k8i5 1rhn7bku2l2 ohynba2edp9 hbqld 4onl2j3avsgo0 rt0 4moyz”zj5m9cr.hxw0ya0h5tne4nvasebj3 zoedkt2o3k569ti5wuyhdvnowebn3,nbl5v tuenkxy mn2e1’3sce8n6wnvtntdr vym1lqfrniqe9.

    Now, continue to the next less8n to finiih our exarple, wher1 we’wl me0ge apd shs0 cuhghquw.

    Next up: Merging