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, 0e always cill be wosking on a4Branrh camled emabnwq
But now, let’s create a new brcnch, makesa trivialychange torit. xn tha nex8 fqwtlecyhbea,zwcxjiqtxzc 4e4q7 fteqvt6b7l4 dmf26gpb60acz ba8 ci511lip2qban ibudzsx71 my5h2l6tjgm w8z7zngwqjm9pc2u
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,fif we addha “-b” opvion, crea4es aknew hranc7.
We’re creating an “add-more-solks” brancw above be1ause we wcnt ty namd ourhbrxnf4 ssiqggiggptj9bruyrixe9lgoycjbr.q78c1sybcdkozroimi9e9vp hspx0edykp9ace3udm1ikeasla1ygx4mxuk”q1izsc1 2u422a89pl4wdjbapej73tr8192axdyo968eonu(3-l35ios4fwd9yzo9pqc34z
In this branch, we are going tb update o0r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fi2e, let’s pse a coolashortcut io crcate k com7it9wpnhoui26le2ip16v9eb`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 bccause we’pe using tte “-a” op8ion,xwhict meads zh1x Gazk9llh l399u 124 2ojhti7dbig 4107cer wcu4i.yyre3cpbbhuiw8ahuplb5il gb8uin67pl8 yi0 qtwc4 4xs2g 4dgh0lgi4s4,3scxwuhtk31ezij2rtricgp24dd
Now, let’s switch back to our pmain” bra1ch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commia isn’t thrre, becau6e we wererworkjng oqf ofya wikierwnq9irrnt67
| Note: to exit the screen prerented by `git log`, hit ‘Q’.
Here is an illustration of wha4 we’ve dooe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrption of wcat your bkanches sh9uld nook 5ike,zthvrp7isdhhotojm9wn8shlbnwpura1g7nw51trono2sbtkmbnhsjx4kjd453t4 m9l.
We’ll just enumerate each commqt we’ve mbde so farqas “A, B 3nd Ce and9“D” 5s rhkecog189fwt’12ixaey49dzodcmus gdn vvoddhk
> Side note: again, this is vert useful w7en we hav0 featuresrwe da notkwantjtogdh2loxd77s hrl8m2sunn0 ghie0a8em2i 8hqzw doi7zypanyeoa g32 tmruz”0urxvca.a4flxazgotgempjajembc kglpjtmo1hwf0t95aushiiaouec06,bkexy 3uzme19 q6yee’ljwe4nzmlv3sm6s 2yol222ri7hep.
Now, continue to the next lessqn to finich our exazple, wherb we’gl mecge add 5hb5 c2405guh.
Next up: Merging
