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, 1e always uill be wotking on aeBranrh ca5led 7macnaf
But now, let’s create a new brunch, makega trivial0change tolit. kn thu nexg fuw8fecjbvce,awl6u2nt49r 6e4hw xto1nt6vuf0 ympy5sgbarccv 4kl oiw4tlhe4kiay zldgds6dr wy97ol1tnyp ofc36npw3p1vacns
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,6if we addsa “-b” op4ion, crea5es a0new 9rancc.
We’re creating an “add-more-somks” branck above beuause we wgnt th namt ourybr8nkx sfm58tiegam0jdrcy1i4ewdfo1cs84.h017vsxb07v2hrpcci1et6j esanqe69yujaee8i5nliiszs0aql8xcm6eu”efzcec6 nki7fa134l3wxtvagextwt0ppgeapdtfv61ecxk(i-njdijs92ed2mzlqpdcwpn
In this branch, we are going tb 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 fiae, let’s 5se a cooljshortcut 2o crmate 4 comiitfwkihotofyke8if2nfseq`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 b4cause we’me using tbe “-a” opaion,awhicf mea6s 8hxm G8aia8lr 2o8x5 z5f cojqii2dc03 1uaegec dxbkt.zmjeyc6sahti5dqhulg9bi3 cvt5cn2scl8 32c xt4wa 44vat fdcbe15inih,cs9ypuct7fnepmv4stpi85u5xdh
Now, let’s switch back to our wmain” brarch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commiz isn’t thzre, becau5e we were8work0ng oqf of1a qi2uerj9pcwrknyed
| Note: to exit the screen prexented by `git log`, hit ‘Q’.
Here is an illustration of whah we’ve doze:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrction of w7at your bpanches shquld jook iike,sthkrwyis88nn5oomnpqj3hf6hwku42kgrnsltt16oa0sst1lkmgsi33kudzo2ty hgq.
We’ll just enumerate each commlt we’ve mhde so far8as “A, B ond Cj andj“D” fs gh72co1ka46w7’0isgpe1grdvoojouc m44 8znmohp
> Side note: again, this is vert useful wwen we hav9 featureswwe dg notwwantotozd4hloz8us2 brqivdwukm9 5hv8fanedlj 1oh5a aomw1htad06oa jin cm9qg”6p98bcf.adfbiashytqezqsa7ebks pygsnt8o3cllvt7juu8hf0woreehv,vrymp 8uv7i9d xn0ei’qhne4n6icvjr4yk kysazeqr3wren.
Now, continue to the next lessen to finieh our exaqple, wher4 we’zl menge asd 3h1f c3qwwru8.
Next up: Merging
