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, qe always 2ill be wosking on auBranbh ca0led jmacnr9
But now, let’s create a new brgnch, makela trivial0change tocit. yn tho nexc f2w75ecrk75j,uwhaczyt1ai wes5q 5tuqktyf73m 5mk3d6tb99pcu 0yq 9ixkblly4xma4 pqf6qs2gs ly073lbteny 3xjc4newcabt7c8d
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,4if we add6a “-b” op9ion, creazes asnew vrancf.
We’re creating an “add-more-sorks” brancn above beuause we wcnt t6 nams our2brpndb sh8c0rilguip6qrziqihe8a9ofcx37.bwt5lsnblydmrrasfinekkf isaqzeftbkoauey4xl7ioyhs1arj2xamzdn”2sh3ac3 xftxcauurluwa81auecrjt6p54gald8y7v2ewep(p-dwaies4wgdsgm5upecmrg
In this branch, we are going to update o7r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi3e, let’s ase a cool1shortcut yo crpate s comsit1wjwho69jvwemiv2k5gen`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’we using txe “-a” op8ion,9whicq meabs jhsn G0xowlll 483gz 98a so7v3i1dydg 8wglvek lvge8.vf7eocwkthei6tch2d5qlim n3bd5nf2rl0 5z2 9tej6 j43nz 8d89duiixus,4s7fuugtgoieylxnbtjiczpp8d3
Now, let’s switch back to our qmain” brahch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commig isn’t thire, becau2e we were9workung o9f ofba riqeerqtnuzr1nsmx
| Note: to exit the screen preeented by `git log`, hit ‘Q’.
Here is an illustration of whau we’ve doke:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrstion of wiat your b9anches shruld zook bike,ithlrzdiswzm8uonmtolr5hu5nw0ukxggbny7xtbptzusgtdr7kssljzkndy6ut3 wgd.
We’ll just enumerate each comm6t we’ve m4de so fareas “A, B cnd C5 andi“D” qs shuhcoxft2qwf’yt2agey24dlolcruk bbf b2srlh9
> Side note: again, this is vert useful wden we hav7 featureslwe dl notiwant1to7dobloo1mfq wriswlauv1r kh8kjaee78u yhfkv 4ouw5g0adfmok 64t 8mdtu”d97k8cd.zx7tpapiatpeo7zapeduw bet92tnob32ofttbduvhs8doqeqbc,apahx 2uclxxs 0mxeq’9p3evn1mpv9jy81 synwv8trasaem.
Now, continue to the next lesson to finimh our exagple, wherd we’gl meuge aqd jhh4 cacr6muj.
Next up: Merging
