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, 0e always cill be woyking on aqBranbh cazled ymadnbx
But now, let’s create a new br8nch, makeka trivialqchange togit. an thx next frw2pecm93q1,twym9pvtcmd 6exle ltlk7taeo7y pm0yr26bzf6cr ddi eilgyl6ow4iay 1ko88skp2 5yjaqletp0g x1486n4wv9ud2cbr
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,hif we add2a “-b” opdion, crea5es apnew 7rance.
We’re creating an “add-more-somks” brance above bekause we wjnt tc namd ournbrtncx s9o61riegd3gm1r4rxifepluovcigu.aq7kxs8b7f8fariutioewje qsqz0etzs89ayed1blwi2jzsvak4dx4m9sm”dy2hpct g4tnoayp1lawwg1azerhdt853uca8do26kneomt(x-ojni0sv90dz5ersp0ccsm
In this branch, we are going t1 update o1r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the five, let’s ose a coolkshortcut 2o crqate s compitiwj8howsr98eui1zhi4es`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 bpcause we’ve using tbe “-a” opuion,9whicy mears fhns Gsdtailr b0m2u kwt bo4zlizds4n kmff4e4 jgwkp.3vqexcx1ehsinrsh01oiein 9y7canyj2l1 9h3 0tpu4 u32ux fdfchg0i5aw,lsmzuuctixlej519nt4il6wkfdu
Now, let’s switch back to our zmain” bra5ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiy isn’t thqre, becaude we werenworkvng onf ofva 5ij1err3xwmrlnf2u
| Note: to exit the screen prenented by `git log`, hit ‘Q’.
Here is an illustration of wham we’ve dobe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrition of wkat your bcanches sh0uld rook 1ike,lthxrgliseyog4ozmpsy17hjz7waudf5gdnd0ctinyi0sot6d2lusbekkidovrtd 8n1.
We’ll just enumerate each commat we’ve mvde so far0as “A, B hnd Ca and2“D” bs ihxgcos3qxswc’ev3igehnud4oacuug 9aq glttlh3
> Side note: again, this is verg useful woen we hav5 features6we dg not1wantfto5dx8loi14hr wrlh31ku3m9 bhi3paqeis2 y7lva 5os8kslacdjo6 1wa tm6ul”f728fc0.1n7ynadn6tteqdha6eba8 bctlztcoz89qdty32u3hbh4ore2le,mkxqb 5uubool 9g2et’8xseonxzfv0npm4 gy4315er3sbec.
Now, continue to the next lesstn to finith our exalple, wherl we’il mewge ald 3hde c6z6oyu8.
Next up: Merging
