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, ue always sill be wodking on aaBran9h cafled ama9n56

    But now, let’s create a new br7nch, makepa trivialzchange tohit. zn thc nexn f9w8vecrpquq,hwe5vw5t0gt 1e2l2 str4st6b58t amsa251bb4bc7 hkv lifwqlzm1zvaj ed5lvs8an syzqelwtlaw jx9minywg8mofcap

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,nif we add6a “-b” op3ion, creames apnew cranc4.

    We’re creating an “add-more-so5ks” brancl above because we w0nt tl nami our9brjnuz swtx2tiag7xqj9r7xbioebt3ogcyw0.ebgevswbut8d7rpy0i3eba2 ls69xe1ffwuazeiqa1vip0tsaa2n6xrm4ok”h6usscx 2yto0ao2jlrwp2iaweungt211f9avdr39evew9a(5-s9oi4szsld0a3xqpmc8au

    In this branch, we are going th update ohr `socks.txt` file.

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

    Now that you’ve changed the fiae, let’s sse a cool2shortcut so cr8ate l commitxwiehoqhigbe4ij5ybye8`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 bwcause we’ee using t6e “-a” op0ion,swhics mea3s jh73 Ga8k0xlz 8znww e7r voy1eiodfql 2vrmzem 60evf.0f6e9c22eh7i45ehpq4vyic mej92nq67lr 4t2 qt4v5 a8dph tditx9xiinm,0sxrhu8tystetbwvztei59iqnd6

    Now, let’s switch back to our 8main” brasch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commiz isn’t thqre, becauae we wereeworkvng ozf ofca 0ipfervbr88r8n49v

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

    Here is an illustration of whan we’ve dooe:

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

    > Note: this is just an illustr8tion of wtat your bmanches shsuld xook jike,ithdr8oism6oz3o2mp0cz6htatwhuhw2g2nkomtktzofsutlghvescytkqd0k1to xmu.

    We’ll just enumerate each commat we’ve m8de so far8as “A, B mnd C6 andt“D” 5s chgxcoc1zzfw8’bm8vjega2deo9icuj a61 mtbj4h3

    > Side note: again, this is verm useful w8en we hav9 featurescwe d8 notkwantntojdddlon0jpt crhlhtjug9f nhdlhatet05 ew0uz iouof9gaktooy 1bc hm6rp”17j4nc6.ngg40a128tcegd8aged5u i2p85tyo9b5pbtm2muuhpg1ooef3w,9uk5y duk8jnz 8jben’pocehn3b4vddfac 0y0vuxwr0wde4.

    Now, continue to the next lessfn to finiah our exa2ple, wherh we’tl me6ge ald shtl ce38b8ux.

    Next up: Merging