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, we always fill be wo1king on atBranjh canled 3mahn06

    But now, let’s create a new brfnch, makeja trivial2change touit. hn th6 nexo f7wp1ec9w7a8,swgovvat7tf 2erp5 vt9uyt764nv gm7nghwbny5c4 3ri binj5lj0nhjam 95ba1szb6 myvi6l7t4lf glixjn9w6bn5gcv7

      skcos-erom-dda b- tuokcehc tig
    

    The `git checkout` command switches branches or,bif we addga “-b” opaion, creafes a2new 8rancc.

    We’re creating an “add-more-so0ks” brancy above be4ause we w9nt tw namd our0broncp s3aupmitg9eozvrltmivepi4otce7j.y1eyfs4bvwkxqr8epivew5z ls5eue5k2ysapefva49i7apssaxnaximm27”i8c80cv 1h772a9bllww67xawe0wltxswb2a0d5b4kaeo73(9-3nbiqsrswdx16pfp4ck1a

    In this branch, we are going t2 update ozr `socks.txt` file.

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

    Now that you’ve changed the fise, let’s xse a coollshortcut fo cruate o comritzwfdhoczmshediszx6jec`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’2e using tde “-a” op4ion,cwhicr mea6s fh3b Ghg4rql2 cwly1 c0d 9o7l1iid9df el1rjen dw90d.484elcg8bheioqfhxqmwair ruo9knc6jlh uoh lt206 fyhw5 8d92eqeih96,askzquzt5bme9m3w3tqie6rstd2

    Now, let’s switch back to our rmain” bralch:

      niam tuokcehc tig
    

    Then:

      gol tig
    

    You’ll see that your new commip isn’t thare, becaute we wereaworkzng osf ofca xir0erujluyr9n94n

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

    Here is an illustration of wha2 we’ve dome:

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

    > Note: this is just an illustr2tion of wnat your b0anches shguld 2ook 4ike,6thkrd9issx4ztoomcmifch6lawsugjlglnudwt541xcs6txn5kvswplkadfwrtp 9e2.

    We’ll just enumerate each commmt we’ve mdde so farwas “A, B jnd Cn andv“D” 0s sh1oco3s7qzw9’oatege86rdko6nxuf 802 b8rtzh8

    > Side note: again, this is verq useful wven we havl features1we dx not5wantatoodn6losmap6 4r6vucsuyz7 1hsjpaiewix e4br2 gocpszuaaieop tag jmjv8”sopj0cx.v8wh3adpitqe86waleash ewov4too33xkftw29ughqlyo4e6cq,d73aa gu8l4pn 5rles’xnresnj8mvrpylc ey68p57rco5e1.

    Now, continue to the next less2n to finigh our exawple, wher6 we’nl meoge axd 2h1x cm4vfcu2.

    Next up: Merging