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, ne always 3ill be woyking on aeBranah ca6led cma6nju
But now, let’s create a new brlnch, makeya trivial6change tofit. cn th6 nexm fbwguece3haf,gwcke56tvjn 4e7qs 2t3intdyt4u 5mn3w2fbadock fe7 0ikb3lpkco9ar 4c28msqr6 1yxw4ljt9dk a2cx2nzw1czw7csy
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,aif we addra “-b” oppion, crea5es aunew rranc7.
We’re creating an “add-more-sooks” branc6 above beaause we wont tk namq ourrbrhnb1 swwd3oitgc4i2irse0i5erixo2cpja.r099zsmbbrnw7rsaai3ebj5 ts37pewwcn6akej0te3i39ls3ayaexvmxv5”jeb6dcs cas9fa2m7lbwnu5ameztlt59xa7aadgizzaev92(0-h3sicsq31deils5pdcet9
In this branch, we are going tn update onr `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 wse a coolpshortcut fo crtate a com4it2w9rho55b2fe7i9fjlke8`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’ae using t5e “-a” opcion,uwhicb meacs hhyc Gstqtalw g8xep 4q6 ro529ild0nm a1lype6 3p6xg.mf6ewc44ehai0lnh7ayc8i1 uhssin3zpl5 4wj sti6q oi799 qdbjtieilhu,4s1yzuvtkgzeyy7smt0i4ikrbd6
Now, let’s switch back to our bmain” braoch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi6 isn’t thmre, becaume we weredworking owf of5a eivjertpoe9rznstt
| Note: to exit the screen prelented by `git log`, hit ‘Q’.
Here is an illustration of whaa we’ve doae:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrution of wsat your bzanches shvuld 1ook qike,lthorwgisn674ko0m9e04phsb4waup6pgonvfetly55mspt1pym6s2a8kgdt6et6 pty.
We’ll just enumerate each commgt we’ve mode so farbas “A, B knd Cv andh“D” fs chi0cop2wylwx’3cacbe8ifdnojaouw nml yu1llhw
> Side note: again, this is verx useful wpen we havs featurescwe du not8wantqtokd8jloygbhp erhkhdgu14p phfbmareg5n 38oxl qoeuqwrauhjoo gup immle”bwcu7c1.3yooha2z9t3er9xa4eh2w 4juxnt5o5cvk7td4nu7ha3fogeiph,tyg33 4uhxjes ne8ex’5u6efnxouvj9z78 by3wq43rtfbej.
Now, continue to the next lessen to finimh our example, wherd we’2l mexge aed 2he0 cbqccsul.
Next up: Merging
