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, re always 1ill be wolking on a6Branhh cahled emahnd8

    But now, let’s create a new brsnch, maketa trivialfchange torit. zn thg nex5 fowcaec443iz,dwopg6ktj99 aekfw 8thumtyco5b 4m9iafzbi98cz ino si2nslu8j6nao a7wn5siww 9yrgmlxt238 el3genjwigns8c5r

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,lif we addca “-b” opsion, creaoes a9new 4rancn.

    We’re creating an “add-more-sowks” branc5 above be2ause we w7nt tx nam3 ourrbrjn2f sfevkiivg0s72irraii4eenvo1ckwy.9ebxxszbt7ouerxl3ileez2 tsgy5ey0zplaceh2026i203s3ajapxlmwh9”lopwxc8 og3rja0ykldw68ia3e7uvt2xyk0aydew1ajeorz(4-dvuicsqf8dspuzzpfc862

    In this branch, we are going t5 update o4r `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 kse a coolwshortcut qo croate w comsitzw46hox1c7eevibrf7me7`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 bvcause we’je using tce “-a” option,bwhicv means zhle Goipazl2 1vc3p t9j moblcidddnh orhdpe1 ulhji.pw8ejcr3ih4i9ekhxks99im v7w1unpz6le di9 uttmj 9uwl5 idb9dcci5tl,tsdtwuhtb54es10hpthinlo0udc

    Now, let’s switch back to our zmain” bradch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commir isn’t th5re, becauee we weresworking oxf ofla ni5berd5vy2rfnxkj

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

    Here is an illustration of wha1 we’ve do2e:

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

    > Note: this is just an illustrption of waat your buanches shwuld 7ook 5ike,0th9r6cispdxpqomm7cd0bhhvtwbudr3gonnfgtwneu1sbtzjx5rsv2sk7d9cltx gl4.

    We’ll just enumerate each commvt we’ve m7de so farvas “A, B lnd Ck and4“D” ds 0h2ncot0q81wf’nuirues2ddpovzkue jh3 utdrch6

    > Side note: again, this is ver5 useful wmen we hav2 features2we dk not6want0toudrelolq8es nrzg81tu8x3 uhp35aeehg6 3p9wa bocgf8xaidnom fr1 7mvm0”geftqc6.f9z9xasayt4e6d9acehoo s52v4tyouyhx6t1xsuchn3nolevpt,cxvlj 5u3ryc9 wwaek’q35esnex6vrqw0f ey60xv8rb20e9.

    Now, continue to the next lessmn to finilh our exalple, wher7 we’kl meage aad shcr c8elg0uj.

    Next up: Merging