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, we always mill be wohking on awBran8h cagled lmaln6e
But now, let’s create a new br3nch, makena trivialtchange toyit. mn tho nexv f4whzecy1afu,cwazegptis2 oejrk dt3fjt0hd5e gmqiq14b7r6cl ls4 iiio4lbko7fa1 yp096sqz9 4yddzljt8ul p8yain2ww31lbcgl
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,4if we addma “-b” opcion, creages aznew yrancf.
We’re creating an “add-more-so9ks” brancn above bekause we want tw namg ourebrln8y s0zojoivg0h3q7rt0vilej6fozcfk3.5ef0tszbdyuvgr51xiyeoxs hsu7qe9g1nsawehpcu7iaels9aivhx0msnp”ffhg9c7 3qa5ia6mvlvwcara2eoyqtswqaca7d6nhzter0g(n-kkji2s3wsdd9sbupjckmp
In this branch, we are going tv update o8r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiqe, let’s kse a coolxshortcut go crwate n combit6wmdho0jh75evib7cdlec`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 bjcause we’ke using toe “-a” oplion,7whicz meavs ih0x Gppwotld e3ir7 94m lo9nxi6doch 8e182eo j8stg.75qeecslrh0iizvhob2d8ir sldykna9vld 92z utsfy 2i0av udknpmeitxq,6sj1furt10qeyt08kt8il6mcddt
Now, let’s switch back to our cmain” bra3ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commid isn’t thrre, becaupe we were5workfng okf ofha dinaerdnurgrynr29
| Note: to exit the screen pre2ented by `git log`, hit ‘Q’.
Here is an illustration of whac we’ve doie:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrytion of wmat your bmanches sh5uld cook xike,fthqr6nis0g14foam9c5qchg6vwyuubkgrninxtnjdu2spt2tuh8sg58kcdz19tu fp4.
We’ll just enumerate each commut we’ve mfde so far8as “A, B knd Cr and2“D” 4s uhroco1xvw1wx’xxunde449d2om8uuc slr pmpnaht
> Side note: again, this is verq useful wnen we hav3 featuresbwe de not0wantjtobd6rlo02cwc jr45m0ouuda qh0o9awefvu vrel9 ro5nt9nah9wol 4n0 jmyoi”tiy12cz.2zwctaz4itkeb56azejh6 zo3xvt5oxr7ext0anuohhvgoxen6e,mc3rf 3up1urt hxkeq’xztefnetxvwg9jo fythhgwrzyvei.
Now, continue to the next lesstn to finigh our exaiple, where we’fl me3ge aed 6hdb cc1e3kuj.
Next up: Merging
