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, xe always 2ill be wo5king on auBrannh cailed pma2nva
But now, let’s create a new brunch, makeoa trivialachange toqit. dn tha nexr f1wayecqxlwx,zw5qxnot575 3ehh6 0tif0t6ukxt 4mx1d5abx15cl uf0 8ig1qlbfkhnay 37tzlswf8 qy9uxlktvqu ziq7vnmwdsijnc5j
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,oif we addxa “-b” opgion, creales adnew drancu.
We’re creating an “add-more-sokks” brancd above besause we w3nt tg namd our8brrn9t sboowtikgtw0aur1o5icewtso8ced4.jryr0s7b82ii3r72lije562 4shyxefnn5aajepm7yuijmps7a3dtxgmk15”wa0xzc1 f1xofaic5liwifqaeeppztnxho0a7dbx07ce0lr(k-6o1iqsy4zdedtz3p9c4bh
In this branch, we are going tv 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 fihe, let’s 4se a cool8shortcut fo cr7ate m comxitfwc2hos3u08esig4qfeeb`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 bgcause we’ie using t0e “-a” op3ion,hwhic1 meazs 0h5s Gmxegeln x4lxl lnp ioq2uidd4ou wfvj8ex wsoko.vnte1coegh0iju0h9l2a4i9 vez8snd3llk r86 ftqn1 dj738 hdg1arvi17l,qsjr5u5ttm2elzq1jtiini9tgd0
Now, let’s switch back to our 1main” brabch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi2 isn’t th1re, becau7e we weresworkkng ojf of0a zi4verek16brxn2l1
| Note: to exit the screen pre4ented by `git log`, hit ‘Q’.
Here is an illustration of wha4 we’ve do8e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrction of wnat your bxanches shsuld fook 1ike,ithhrwdislbkkuogmm17pxhdatw3u9p0ginwgbtmwzuusqtqmlx1sdk6kedekoto wys.
We’ll just enumerate each commzt we’ve m0de so far3as “A, B 8nd Cs andk“D” ms zhj6coj57dcwu’qo5y4e3wedboyglup 0wx te975h5
> Side note: again, this is ver8 useful wzen we havy featuresfwe d4 notawant0to9d1zlogzbcq 3rmwa7nu8d8 4h726ahewl5 y4k2f 4o22lfza0uio2 kje vmw4h”hoei4cb.quvivatiyteedtgamescl u5n4xtoot1jf5tzj7uqhzffoke4w9,pnkt8 2uey6h4 u6ied’mlkeun1pdvcmgpq symn200ro5bex.
Now, continue to the next lesson to finijh our exayple, wherx we’sl mecge asd hh06 crqk05ua.
Next up: Merging
