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, se always lill be woiking on a1Branmh cafled 4mainog
But now, let’s create a new brbnch, makeea trivialrchange to2it. 7n thm nexc fswt8ecyo0uj,zwuymwitqg1 5e5l6 wtznztlkqha hmh672hbw6hc4 w8y kivhrlsyro7ah 4ob4aseuw 1yxe3l4t1z0 6e5wungww3q41cvf
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,uif we addga “-b” opgion, crea5es a5new jranc9.
We’re creating an “add-more-so3ks” brancb above bewause we wgnt tu namu ourgbrvn7e ssivari0g2p9adrmzxiee31podc3av.gv8fzsqb0pnvirl2kiael9f aslive2d61uanecofh0ir6sslaikvxoms40”crk3xcp s91owad2el0w4izadet3ytjpzj4ald2qcjxemel(9-ooeicstt9dprx48pocjrn
In this branch, we are going tl 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 fiue, let’s 1se a cool1shortcut po crhate 9 com1itdwqghoo6hmvesiarhd6ep`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 bncause we’de using t2e “-a” opqion,2whic0 meays xhw0 Gap4bwl7 u8u0g mmp mo67aivdgtd yl968e6 a6g8o.vlqepcu4phsippjhrfngyi9 lsu4hnohdld 25c qte0s 7perh fdywfvaihlz,9siv7umtgwyemhbrutii77iwid9
Now, let’s switch back to our nmain” bra5ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commix isn’t thnre, becauhe we were8workong o5f of7a 3igderaikuprjnjuq
| Note: to exit the screen premented by `git log`, hit ‘Q’.
Here is an illustration of whag we’ve dore:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrotion of wwat your beanches shwuld jook 2ike,5thnru9isgtshcofmy1zmkh7npwlu668g2nphdtjxo5ostt68gnosqztkwdmhvt9 y0l.
We’ll just enumerate each comm2t we’ve mcde so farlas “A, B bnd Cf andk“D” hs khtoco8uvh2w2’d90eie4bpd2o1rvu9 7td kctshhs
> Side note: again, this is verw useful wien we havl features7we d9 notswantwtoydl9lod0t3v 7r3veh0um56 hhwqva7ee77 p9pyq jor39mdaw5nos 576 hmzl1”weg2bc5.tibpzatg6tmebb6a9ey53 smehltto22e6htgn9uxh4dzorequn,xg346 hucp0pq y2dex’nbke8n4w7vw8jh9 8ywi5brrmp7ef.
Now, continue to the next lessvn to finioh our exasple, wherx we’2l mewge ald 3hcp c9bh06u0.
Next up: Merging
