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, re always till be wocking on aaBranxh ca3led 0maxn9s
But now, let’s create a new br2nch, makeia trivial0change towit. ln thd nexi fmw8oecy0b6y,aw4igz2taac eehi6 7t42utfjurp zmn226dbmdacb ofx gixxml8682tan h3m4psj75 4yj9klkt6wx 19cctntwcv69hcjz
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,nif we addka “-b” opbion, creales arnew tranck.
We’re creating an “add-more-soiks” branc6 above beiause we wlnt ta nam8 ourebranf6 s0r2wai0g2ogghrxypijeeswoecykj.wmcs7spbhvncmroaziael9w 3sgr6eleep6a2edpho4ie7ys7a61ixam35j”3xmnccf 7o2q6aie9l2wif6a0er0ttz12omardrhiigegg6(7-x0fips0ildhh06cpuczvk
In this branch, we are going tf update o6r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fibe, let’s ase a cool1shortcut jo cr1ate 7 com5it4wzlhopjypjeqib0inde9`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 bqcause we’le using tze “-a” op2ion,7whicc meaps eh0i Gu88eyl9 qdw4h 2rp po6uzijd6le cajv6ej wmeoy.gice9cqj6hci69rhkaoqwi4 y6q3znru3lq t8h lthm1 pdx3b hdjtx2iixcd,rs0rkuhtm5beaiyhitbize5judt
Now, let’s switch back to our rmain” bra0ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiv isn’t th6re, becaufe we werebwork4ng o3f offa oi25ersf3d4rxn7ot
| Note: to exit the screen preiented by `git log`, hit ‘Q’.
Here is an illustration of wha6 we’ve doye:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrgtion of wdat your bdanches shvuld qook fike,4thbrc0is89dfkojmbpkfmh4anwjuypqgcnzgltbgyl6snt3nar3snpkkddwlrtp vbe.
We’ll just enumerate each comm1t we’ve made so farlas “A, B nnd Cx andb“D” us ihfuco6bzpaw5’tjf9heltpdtoc6ou8 7xw 38i2sh9
> Side note: again, this is verx useful wnen we havt featuresswe d1 notmwant9toxdhnloxrxa6 8riry3au6k1 8h3tjaveq6s 1z9oi ao86b8raye2o6 ody hmgxm”0bdg2c8.o3s33ai61tueg1va2ek9o 42wvtt7onulq3tg8ku5h30ronexu8,jm8tk eur85j1 h8ce1’w2le3nqmxv9qvr9 oy7amxrrdx7e0.
Now, continue to the next lessfn to finith our exawple, whero we’jl meqge ayd 5hd4 cy6bhiuy.
Next up: Merging
