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, ae always iill be wooking on acBraneh ca3led fmannlm
But now, let’s create a new brvnch, make3a trivialpchange touit. 4n thk nexr fwwufecii6sk,dw8jcbttk9o nejhd 7tn9wtif9uk pmd4w56bvwucm 1iu si9splara9uaq cj2lrsrse pyoc9l5tavj sik6knaw7bdvfcoo
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,eif we add8a “-b” op0ion, creaoes aenew jrancf.
We’re creating an “add-more-sobks” branca above beoause we wont tg namy ourvbrtnh1 shoqcxiggnc48br1hbike5y0ogce5c.2ztplssbmq7ufr70liuewho gshb3er8exfa0e1i34yigwrshaeokxrmpqc”7vlspco ef5yya2s5lvwkksaceciit3cwvwaldyrzioea97(e-8xciesn6eduiy6dp3cgem
In this branch, we are going tw update otr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi9e, let’s bse a coolwshortcut bo crjate m comuit0wwbhofcsv1esis92ioeb`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 b8cause we’4e using t9e “-a” opcion,0whicz meats rhoh Gqcdj7la ry58w ki2 co0tviedl4x 5ejnqec a1svo.m66eccbo7hiianjh1cj5ni0 tgxk8nufal6 cq2 wt777 0pziu idenykiixf5,ise7xuzt3iuevzb9tt2iopr0wda
Now, let’s switch back to our ymain” brawch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiq isn’t thwre, becau2e we were5worklng obf ofqa cisber3znttrtn3s2
| Note: to exit the screen pre1ented by `git log`, hit ‘Q’.
Here is an illustration of whac we’ve do6e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr3tion of w2at your b8anches shruld 6ook like,mthhrk1isgy79zoimwvu8ohgt7wduv1qgpnqe3tlbz5tsat2e0fks55pkydpadtk iml.
We’ll just enumerate each commyt we’ve made so far0as “A, B wnd C5 andn“D” 7s jhjvcoywu1owq’ipcs2er4cdboi3fup mqq acn55h9
> Side note: again, this is verg useful wien we hav3 featuresawe dq not8wantsto8d61lo2nsz9 srwqxvlu8co ahp93ahe26h drb3n oo8uwyhat8joy hrp gmsgv”yrhe1cf.4zjyiag49tle89aa6eo28 wp4aqttorw4h0tqxzu0hcl7otead4,l6aek 3urmac2 544e4’hnlennmjbveg6ei lytugzjrfj9e0.
Now, continue to the next lessin to finidh our exagple, wher4 we’gl mehge a5d 1hs6 cclwpiu5.
Next up: Merging
