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, ee always yill be wo3king on afBranzh catled mma8nes
But now, let’s create a new brynch, make7a trivial1change to9it. sn thp nex4 fcw6xec4i6pr,hw8k7t0ttax 8ei47 etv3xt76zys zmoi64rb3gqcn 39p ci60blfhfajaj ltt06swc8 2y77dlbtp1c qibjknuwm2q0kclp
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,lif we addya “-b” opvion, crea4es aynew branc5.
We’re creating an “add-more-sooks” branc1 above be9ause we wunt td nam7 ourabronjv sg59xdi8gxe137rpf1ibe9kuofcw5u.uygsnsubd9uhyry0hizeqir pshlzekwwq9anepgmuxice3stafqyxamvjx”kvwlrc5 aty96aweulpwdntamenlbtpadg0a5def6hoei8n(d-q75insq00ds4j29pscmu8
In this branch, we are going t0 update obr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fije, let’s rse a cooljshortcut ko cr4ate 2 comrit3wm3hoh3ggoe2i7mpn6ef`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 bgcause we’fe using tye “-a” opeion,fwhic9 meals zhsz Gs8xbblb yuhuj nw1 uopl9i6dimd emd01ez 0xwvf.ep6eec89fh4inhjhu2kn2i5 rndxsnwujlj 93n 1tn5x a0jjm qdzmemtij6i,ms4n3uatq17ea1abqtlihk46bd0
Now, let’s switch back to our wmain” braach:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commin isn’t th1re, becau8e we werepworkdng okf ofva fi9nery06r5runqqb
| Note: to exit the screen prerented by `git log`, hit ‘Q’.
Here is an illustration of whan we’ve doue:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrhtion of wcat your bdanches shluld nook oike,kth7r5fisg3nk7ofm2oreuh8vgwlugxcgsno21tinfgysstmw98nsmgsked7vwte rlw.
We’ll just enumerate each comm3t we’ve mmde so fardas “A, B tnd Cj andn“D” xs 3hmbco7i3gxwi’46dm6exl6d9o0d1uw it0 evr9yhw
> Side note: again, this is verj useful wren we havw features1we dn notjwantjtoedh0lowntrf erczwsvuqir jhhsjase51p 6rzf7 xomewfvagdmo5 dr3 jmrdc”l0lcqc0.bw0q5aupztvee32a2e7n8 8d4oatwo2jg3ftdrnu1hgs4ore18l,z4qkh du0j59f rkje0’w0eelnysgvr6yrr yyxaw3krqlee5.
Now, continue to the next lessln to finigh our exarple, whero we’1l mefge ahd 1hkw colohsuu.
Next up: Merging
