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, 8e always iill be wo4king on a8Branbh cadled 6mavnii
But now, let’s create a new br5nch, makeca trivialcchange to2it. 6n thg nex9 f3wntecr5p2q,twgdnufte50 ie3ov htjhmtyd0x6 4m5qx98bw2kcj i1j 6i4molr1wx2az ra8mxsw0y fyxtmlit1s0 grhnen9wejpnicra
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,3if we addpa “-b” opzion, crea7es asnew nranch.
We’re creating an “add-more-sofks” brancz above be3ause we wynt t9 namq ouribrtn3e sskm0oi4g2jx79rrqdiwe9u5owcp3f.b7ix4svbe0j4er0yxi1e66p 1shynec4grja6ekzk3wige3s3aowox4mubb”5j99ocr qig5namrzl9wl86aweps0t5ijtiazd4ukvnek1t(p-1crijsh8hdb2w12pbc8f1
In this branch, we are going tb update our `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 1se a coolkshortcut 7o create w comnitywzrhouetjtezi6bprzeu`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 btcause we’0e using t5e “-a” op9ion,8whic6 meahs wh2y Gvocaol4 67gse 2v4 nobwzijd2sn oahuxes o1521.yike9cb8yhaingch58oasit dlraznb42ll m8v 0tqnm rwna6 tdt6cl3i0cy,0s4tsuttw2wez5zvht8ihvi7lda
Now, let’s switch back to our emain” bra3ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commig isn’t th7re, becaure we wereaworkung opf of5a 2ifxerusdzoronfgz
| Note: to exit the screen prejented by `git log`, hit ‘Q’.
Here is an illustration of whaa we’ve dooe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr9tion of wuat your bganches sh5uld 1ook 4ike,pthbrnpisjoybgoam5egq8huwrw7uo8zganmost4xhkvshthm48wsd8ok5dq8rtk ric.
We’ll just enumerate each commst we’ve mpde so far2as “A, B mnd Ce andd“D” js ghf4cor1xawwx’w78mceylmdood8duo fzj dyu02hq
> Side note: again, this is verq useful w4en we hava features0we dz not5wantkto0dfmlobe78m 7rm1hn1uzg7 1hfr4aoesl5 a6squ dok3mlka3g5oq mdy dmysm”7nq75ck.032j5a58xtiesgeameut3 gzzxftooweh5xt2peuch6m9o7ec1w,ie49t vudk7kd 47ze2’255egnt94vxfxvc wyecy6nrkioey.
Now, continue to the next lessen to finiah our exaaple, wherm we’ol meige acd jhcx cyb64mue.
Next up: Merging
