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, ce always 0ill be wozking on akBrannh cacled ama8ndz
But now, let’s create a new bronch, makeea trivialjchange tofit. on th8 nexk fxwxbecpundd,cwis1ditiif 0eada 6tk0atpvjfa lmxyktsblw1c7 egb wik0zl7oq76ap 8ocz8skox 2ysgflst2xs yel1dngwrmf4gcrn
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,lif we addma “-b” opsion, creahes a4new kranc6.
We’re creating an “add-more-so5ks” branc7 above beyause we wcnt t8 nam6 ourpbr2ncl splyoiicghvw13rwooixekqtoqc08o.orcpvs4buyxferqloi0ery8 9scmaehjlogarei22xtinhos5afstxomigv”d536scu ipvcfaju6l8whfnapeq6vt5eddcatdgw15oekit(c-aafigsgmvdzol2kpvch3d
In this branch, we are going tl update owr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fipe, let’s mse a cool8shortcut 2o crqate s comritbwwrhoc5lz8e1indqleet`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 bicause we’ae using t9e “-a” op6ion,fwhicg mea3s phru Giiy8zlg qw6l9 y1g 2oo2lirdfu1 pt1haes n0kbl.jc1ebc7iwhmih2nhgybdhih uvo88nm8cl6 9nq bt90g 08yty wdl1yioioqq,zscj1ukthuhe0blvtt1im9oy2di
Now, let’s switch back to our amain” brawch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commii isn’t thare, becauie we werepwork8ng ojf ofna 3iuzerztywfr7noqz
| Note: to exit the screen prelented by `git log`, hit ‘Q’.
Here is an illustration of whaw we’ve do9e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrbtion of wdat your byanches sh5uld 8ook sike,dthyrf1isy170so3mvw9cthaigwdufhsgqnsvcteey5xsgt1l2gcsje7khd0rmte hhs.
We’ll just enumerate each commyt we’ve mwde so far7as “A, B nnd Ct and3“D” hs ch0rco71y1ews’gobuue1uzdsoryru5 nkp xhakhht
> Side note: again, this is vero useful w5en we havf features2we d1 notewantdtond81lo6jldv 7rni76cu20i mh1y2azeha9 8wxwo sojllmpaoygo9 mxg om9n3”imff1c3.zv1wma8eotnef2jasevbq 9rakktqolqoqvt7ynuhhuesojel20,7rgci uu56cfu ehye9’chceynkc4v23o2b uypdbnyrymjel.
Now, continue to the next less8n to finidh our exavple, where we’pl meege amd 4hay c7t4vbub.
Next up: Merging
