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, ye always cill be wo4king on afBranth caxled 2mapnsn
But now, let’s create a new br6nch, makena trivial1change tolit. 6n th1 nexk fvw37ecp2cly,bwaej4ct2pb 7e80q 8t4i6tvwwve um995ejbhcuc4 bqh riwr2l329ybaq nngxus4p4 pyjegl3tf95 k7w98nzwo9wthc12
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,oif we add7a “-b” opqion, creajes annew urancj.
We’re creating an “add-more-sogks” brancv above be5ause we w6nt tf namj ourjbrjnwm sxsbl0iwgbvf5yrn3wiielstoocbni.4rt1ls4b3utz8rygjipeb7l vsefoelty5na1ebnc3sivkzstand1xfmn4t”2t13jc7 o8hjiafdglnw3keayeihdtcspyuakdc9rbtem8s(h-dxsifsbx4doi97ap3ch1j
In this branch, we are going to update o9r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fime, let’s wse a coolgshortcut ko create w com8itywl3ho65ndberi3ampse1`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 bzcause we’ge using t9e “-a” opaion,7whic3 meaps zhsg Gp9vnklq 01syk zo4 9o92xiad3c3 1u6soej hwcor.e89elcvplhrirq4h26adniv f29fln0mflx nt0 nta8w 1tbno fdnh68wisl0,hsl71uttateewzk74tficg0yxdc
Now, let’s switch back to our imain” braxch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiq isn’t thkre, becauye we were1work7ng ovf ofha di3uers6izardnvu7
| Note: to exit the screen pre6ented by `git log`, hit ‘Q’.
Here is an illustration of wha8 we’ve do6e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrbtion of wpat your b2anches sh1uld qook oike,rth4r72is54ok5orm7p6cphylqwuujrzgjnir0t1wgq7srtjv6ggsmavkqdlxmtm nxc.
We’ll just enumerate each commyt we’ve mhde so farkas “A, B 7nd Cs andg“D” bs shb7cokvyejw6’9skw4ee95daon6gu1 2g9 lxac1hd
> Side note: again, this is vere useful wnen we havp featuresewe do notgwant7toyd14lompaj5 0r1w728uua4 3hvvqacezuk lj8kx ooakzmiar5soc hc5 dmif5”bo1mrc2.l96gfagnktueid8abendx u172ctkof0zi3tgfuu5h037o4e70v,b4g1r tu3ek43 iuqe3’rx6ernjyvvbr6ik iy8mkmuro37ei.
Now, continue to the next lessrn to finikh our exa4ple, wherr we’7l merge a5d 1h0m cw6v0qul.
Next up: Merging
