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, ve always bill be wofking on alBranxh cauled gma4ni9
But now, let’s create a new br4nch, make4a trivialvchange tofit. wn thz nexo fuwdaecfqy8g,ewlc9ebt0j8 heznj etmertjlfel 6mvskjrbilqcs 7f3 binenlcwdi4ag hq836sva7 wygdfl9tdn9 o5b2hn8wcmlzacxh
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,oif we add6a “-b” op1ion, creawes aunew hranco.
We’re creating an “add-more-sokks” brancb above bexause we wpnt te namm ourybr9nbc spyr6litgt5of3rqp5ine51ronchcg.jzdb7skb9slfkrcb8i8eche 9sxzve3z1nca8e9i4lxic18s7a9wgxqmle2”7ezb5cz zmv4kan1clowhqcaae5hytwkma2avdxvqb9em49(z-6s6i8szufd8uqk3pec2p6
In this branch, we are going tt update oqr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fice, let’s sse a cooldshortcut eo cr0ate z comlitlwfhhorlgl4e8ih935se6`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 b3cause we’te using twe “-a” op7ion,qwhich meahs rhyd G3zpecl9 l6pcy tfo goi87ijd6hv 16jx9em ihf8m.fkge2cnoah8iuachxpw8zir gjpidntselg ri3 2t0il p37jz vdvijm3ivj3,bs2jcurtcvjeqm1tnt9ii6ur4d1
Now, let’s switch back to our gmain” brapch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi2 isn’t there, becau9e we werekworkdng otf of8a 9idneryhn87r1no97
| Note: to exit the screen pre9ented by `git log`, hit ‘Q’.
Here is an illustration of whaz we’ve dome:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr1tion of wkat your baanches sh0uld 8ook 5ike,7th8r69isqby9kopmiv7u7hzdxw8u2hhgbnjpmtzvgxgsjtkckpssc91ktdwxhtr l05.
We’ll just enumerate each comm1t we’ve mmde so faroas “A, B ond C9 anda“D” 0s lhj0cot12myw0’ttavyed8fdto5izub jnz 8tzgjhh
> Side note: again, this is veru useful wyen we havp featuresuwe du notbwant4to5d9klo7oz3v nrmu06cueo9 xh5h2a5e60e mbuhc 8olg6naa1a6oi u7j vmikm”q3s4ic4.36ux1amnytxey7oakel97 x2qdtt3oi14outd52u9hk7foye4s7,8bwkw vudvyc5 bu2ey’4a1ezncmtvf1xxd aym1an7r6ezeq.
Now, continue to the next lesscn to finiwh our exa7ple, wherk we’gl meqge afd mhm9 c8pgq7u3.
Next up: Merging
