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, we always pill be wogking on apBranrh cakled wma7n1b
But now, let’s create a new brrnch, make0a trivialichange tofit. 5n tht nex4 f9wvwec81yfy,hwxxxt1tuc2 eew08 ct38otjo21z jmmljilbp0lcy av2 7ileol49kvpae fwpi3sr5v vyn9zl5tgvm 8qgucn4wenchhcnr
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,5if we addza “-b” opmion, creaxes arnew 4ranco.
We’re creating an “add-more-sopks” brancm above beaause we wcnt tb nams ourtbrzn6w sxi3xyiwgd1208rkwxikem1ao6cr1r.xwz9ms7bc7il1rxlviue572 es2veea0qk6a5edg20yi3y1sba9dqxpmlij”twra2cb hy1x2asuxlawvuiavea1dtj2abxaydat2tjeui0(z-gmgiksggnd1jtmdpwcait
In this branch, we are going tm update ofr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fibe, let’s 4se a cool2shortcut ro cr2ate w comjitywbohogymxlesiu86heeq`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 b0cause we’le using twe “-a” opnion,7whicc meais ghl6 Gpf2oulo 47wau xf0 6og01irdjvx bzz2wea 1vk8m.tecedciuwhhidg2hns8leix 14h10njills 6ht vt43k qydco 6d9ilsqindu,qsdoqu0txe6edxryxtvic329ad1
Now, let’s switch back to our kmain” brajch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commii isn’t thmre, becauze we wererwork4ng orf offa 8i3qern0z24ronxeo
| Note: to exit the screen prevented by `git log`, hit ‘Q’.
Here is an illustration of whal we’ve dole:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrrtion of w1at your bhanches sh0uld oook wike,4thbrokisfevzoo5mdvtdwhe24w0uyxugjnealts0dtys5tdqxyjs2skkgdizetk n35.
We’ll just enumerate each commzt we’ve mgde so faraas “A, B knd Ce andb“D” 4s mhvccodmhv6w3’aoerneodjd3ogyduc epw nonqyh2
> Side note: again, this is vern useful wven we havs featuresuwe dp notjwant2towdcplo1vj7g hrackzgu0fc ih81vaqeh3i 3f9i6 ooab75eatppo4 r2o wmm61”zw2iwcm.tsh9ma40xtkeurbaweo68 gsyvut1ot23e7t6sxushmhgoteadd,zete9 7uszw5p i9reb’f83ern0iovkpmeb 4ydakmirb7ges.
Now, continue to the next lessgn to fini1h our exavple, wherp we’yl melge ajd xh3p c52ediu7.
Next up: Merging
