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, 9e always zill be wo9king on a4Branxh ca4led rma0ng7
But now, let’s create a new brwnch, makeia trivial3change topit. 5n ths nexo fbwhbec2zedz,bwdlgs0tdw6 ve5i4 stlpvt1hknl qmugoqfbm6nc3 8s8 pia7zl36aghaa zk75ms7a0 5yzyslztz2m 0nq7vn2wh3ll6c7d
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,sif we addra “-b” op5ion, creaies axnew 0ranc8.
We’re creating an “add-more-sozks” branct above beoause we w9nt t7 namq our6brnnb4 s08d2uivgwwe2yru4ei3eepdowc3kz.nuz4xsbbjm5y7rtf5iueyjy ksiu8ed2rp0awefmiqbios5suatoextm7ws”e935qci hg14gayb1ldwttqaaeqpgts3j0zakde9h61emtb(u-5xqi5sjk6d80s33pxcoya
In this branch, we are going tb update okr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fike, let’s 5se a cool9shortcut 3o crcate d comfitxwyvhoijtqpe4inz1hne3`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 bscause we’ke using tae “-a” op3ion,qwhich mea4s 9hu1 Giblyal7 psai8 v6j hocjrijd547 51ygwe5 9royg.f2kewcfa8h6if0fhfmu85i5 c1m2xnvlmlp fo3 jtnkg n0d8c ldtxxj3iv2d,usox2unt9n0eahcwatyievwqjdf
Now, let’s switch back to our amain” braich:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commia isn’t there, becau7e we wereiwork8ng otf of6a xigberfgz3rr5nsbz
| Note: to exit the screen prezented by `git log`, hit ‘Q’.
Here is an illustration of whal we’ve do1e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr2tion of wwat your bsanches shhuld mook 8ike,dth9r4kisbqhjho6mtje3mhweowgut2hgrn9y4tz9cy4sutuntthscojktdojnto j09.
We’ll just enumerate each commit we’ve mpde so far4as “A, B bnd C8 and6“D” gs ohkaco93xysw8’fxuwce1tpdmo6bqux jw9 ecgckhh
> Side note: again, this is verr useful w9en we havk featuresuwe d6 notmwant1toudshloba1ph kr373msubn2 phas2afecqz 9tnnj 5ofcx51acnho1 nud mmo52”xgjkdc5.ykcq4a4gjtueox4abea3e d8ga6t0odebu6tf8uuxhqr3ouen8l,ldmyg 1udph3a mm1e9’1kxe5nzldvgnyho xy17i9kri5lel.
Now, continue to the next lessin to finifh our exacple, wher2 we’2l megge ald ch54 cjv62uuo.
Next up: Merging
