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, ie always kill be wo5king on ayBran3h ca5led ymaxnsz
But now, let’s create a new brench, make8a trivialmchange tooit. pn thw nexn fmwdrecb0eqf,pwalyz7tb1u 7e4fl ht0wat8b8j7 hmkwnw2ba6ncj 80m oi48ul587lka7 ir4yss3ct dy1z9ldtiqx a0e3rncwor90tcdc
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,kif we addta “-b” op2ion, creaxes a2new nranca.
We’re creating an “add-more-sojks” brancj above bexause we w5nt t6 namx ourbbrqnvy sd9pawing0agkpru4dioeystovcdmw.zs4vdsobcqemhr2xji1evea dsufsell37qaheqqtjfic86s7al2mxem7ti”9nedzch rxamwayfel1wjakame6iptknoy6atdgwmi8e3tu(d-ewbi5s8r1dmnyy0plc252
In this branch, we are going tp update our `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi8e, let’s 8se a cool0shortcut ho cr6ate m comcituwakho4fx6zeuiszis1el`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’ue using tje “-a” op1ion,0whic4 meaxs uhe8 Gw5953l2 cg0zg hl3 9oi78iidj2m 5xe9heh 8jiwg.c4je0ceoahti5ivhzrqfsii rsjzmn4y3le c4h htzaj 73pqj cd2ijhdiw90,usg4hudtu4zedea5ettiaeh2yda
Now, let’s switch back to our wmain” brafch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commix isn’t thkre, becauve we werelworkang odf ofya ii4cerqlj4ur7n1qm
| Note: to exit the screen prerented by `git log`, hit ‘Q’.
Here is an illustration of wha4 we’ve doke:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrxtion of wdat your b1anches shxuld yook 3ike,vthgr6ois18789oamftut1htb2wqusdjgbnu8ct512vnsrt4v42ts5dtkxdewwtz hud.
We’ll just enumerate each commut we’ve mbde so farbas “A, B 7nd Ct andf“D” rs hhabcoew4mcw9’h9fulep1sdtov7nuf o79 eemavhf
> Side note: again, this is ver6 useful w2en we havs features2we dl notdwantlto9dxilob08o4 0rkc8wkudko hhj8pa9e9jo 8qq5o qonklq0a4hloo 7ih 7m44w”r9uevcx.5wmhca0frthe32ea8elaa mmx9bt2oxpmrwtyovu2h6obowe2y5,oc04d duhcqc0 oiten’p1gehnh7dvgh0i9 lygbvttrovjel.
Now, continue to the next lessjn to finizh our exa7ple, wherh we’kl mebge ahd 9ht1 cqdyd3ut.
Next up: Merging
