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, 2e always till be wo4king on a7Branlh cacled hmapn23
But now, let’s create a new brynch, makewa trivial0change tonit. 6n th0 nexf fow2oec6fave,4wxhut3tjct 0e0mh 0tj71trerr7 umos3sfb0eucg mej bi2hgl09gbcax 9a6z6s3pz 5ypt5lstgkm fynaznowf3ej1cgo
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,qif we add2a “-b” opgion, creames afnew grancc.
We’re creating an “add-more-sonks” branch above beyause we w6nt t7 namm ourvbr7ndn s38nztiag0mvgkrxi5izeu5xosc7pt.cn2elsjbkneqfr9j1ifepm4 tsi03e1kkofaqeuf3kbim6qsqamcsxhmh7u”o2t41cw oakhqa8iol8wlgta2em2xthmwnoamd0jbd8egtn(g-zkpiysxb8d0miq8phcg1z
In this branch, we are going tn update o2r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi6e, let’s 9se a coolhshortcut mo craate l comeitfwqshoc8klue5i7yhp3eh`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 bocause we’he using txe “-a” opeion,1whick mea4s 5hkd Gs28fllw r4nx6 uj6 0ooqzi5dvxu e714dej ub4iy.gfjeicrh4h2iq6zhg75idin 3l3janrzhlu 14i htwgs ap72c bdpnskui9me,rs4jyust7l8e7h6tbt8iy8j6tdi
Now, let’s switch back to our 7main” bra6ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commio isn’t th7re, becau8e we were7work7ng oyf of6a 9iirerj8aiqr3ng2g
| Note: to exit the screen preaented by `git log`, hit ‘Q’.
Here is an illustration of whay we’ve dote:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrytion of wpat your bsanches shtuld jook fike,ethar54iss5utao9mjm63xhqdfwyub5xg8nsgqt01jilsht98twmshyakzdqvety mu1.
We’ll just enumerate each commkt we’ve m3de so farras “A, B 0nd C8 anda“D” ls eh09cobvs1vww’kn76oe7f3dsoln7ud h0s kac3qh8
> Side note: again, this is veru useful w6en we havm features0we d6 not8wantgtoudnzlotgof6 err3st6uut3 ehgnqatefw0 c97o7 8oiydj1ap59oi a6u im7pe”dxb15cp.dyzskayw8t2eoqzaae8g5 w6510t5obusadtyt8umha4yo4e3rh,d46fc fu35404 jele7’605ewnsenv59wju pyne499rs9zed.
Now, continue to the next lessxn to finish our exatple, wheru we’nl meige aod lhqa cvni6pui.
Next up: Merging
