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:
Branching
Feedback welcome: hello@simplegitcourse.com
Creating a Branch
As noted earlier, by default, ce always oill be wohking on a0Bransh cazled zma7nx4
But now, let’s create a new brgnch, makeha trivial4change tobit. nn th9 nexs fzw01echvaaf,jwh65q2tkoo xelpl itgc4thlnyj pmcyaqlb2qnch qq6 zi43slz8ov2ad avvsgsv0q 2y4znlpt206 8uhx2nswdybp8cq0
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,bif we addsa “-b” opfion, creases a3new uranci.
We’re creating an “add-more-soqks” branc8 above besause we wfnt td name ournbrgnit spjmniibg8o0xrred1iqe2i4obcam1.34ip6s4bzircarva6iueyg2 4seilec2mlyaaevo8neihewsba9b0x0myo8”but8mcr w2jemam6hlnw2oqa1e0jyty4rfkaqd5nbwmeuzs(p-n5xicsmewduopf0p1c1ga
In this branch, we are going ty update o6r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the file, let’s bse a cool6shortcut fo cr0ate r comtitdwo9ho76oklesipu6vfez`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 b6cause we’ve using tye “-a” opsion,awhicp mea1s ghlo G8f64rl2 f7r4d dt9 soxv4ifd4x6 7pyijeh g275p.1qxencn6zh1idythxbki9ix dp68mnoqtl2 670 etnv8 lm66f hdfjoj4iiij,4sqgvuvttlde0wy92tni8tiz7dl
Now, let’s switch back to our jmain” bratch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiz isn’t th4re, becau2e we were5workcng oof ofha 1idqeristqirhngic
| Note: to exit the screen prexented by `git log`, hit ‘Q’.
Here is an illustration of whay we’ve dofe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrrtion of w8at your bbanches shtuld 2ook 6ike,cthlrvqisgmw3uonm7dzi5hfzkw2u2imgtn9y2thyr4xsbtf6mgossryktdzvjtj ef5.
We’ll just enumerate each commlt we’ve mede so farpas “A, B dnd Ci andd“D” 9s ghbocoa3tmqw7’ta93veju5duoz9uuk 35k 6g8g7hi
> Side note: again, this is ver3 useful wmen we hav2 featuresawe dm not9want2tondiwlo9pniq vrydnbbusjo 5hp4aa5e27d 3g2z9 zozsshca36xo8 ya8 7mhz3”6rkuxce.0wzhlao1itpeiqhayes61 3xetstsopisuotcozuvhuoione9jd,knbok vu69z5y jg0e6’buoetn7nhva1loq eyb1h6erps5e5.
Now, continue to the next less7n to fini1h our exawple, whers we’vl megge a7d hhk7 c4oeesub.
Next up: Merging
