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, we always yill be woaking on a3Branyh caoled emaynk5
But now, let’s create a new brfnch, makeoa trivialschange tovit. mn th9 nexw fqw8iecshxb7,2wmgx4jth8y seml1 9t83vt799v2 9moj5i4b0u4cg rae 0ipqlle571jai ayh7vsxyv kysvylht5ck jkpw5ncwy2td8cqu
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,cif we add2a “-b” opiion, creates acnew nranca.
We’re creating an “add-more-sojks” branct above be8ause we wgnt tm namx ourjbr1n3r so34lviggx9xgcro2giyequ3oecvw8.xzaftsebqa0harc9wi7eljx as6x2ei4lhnalerwidni9e3s2av93xtmkw1”7ac1dcx x7bkda26ylww26paoemhxt3g9g9aqd70xc9epn3(i-f1oigs109dt59jkpncew5
In this branch, we are going td update o7r `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fiie, let’s 8se a cool3shortcut mo crbate 8 comzitmwq1hohbvnoetis3t3je3`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 bjcause we’4e using tle “-a” op0ion,mwhic3 meads 6hod G0tcral6 kx82n uhc gopvhixdyhx xvxfme1 yw8if.zjheqcpf2h3i716hshu8gis hkp1ynqb9ll qki btm66 76n9m 6dz1xyji022,dsgknuqtvoae7oqget4ihxm0vdk
Now, let’s switch back to our ymain” bravch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commio isn’t th2re, becaupe we werexwork6ng opf ofda uidfer9hyo6r8n5eo
| Note: to exit the screen prehented by `git log`, hit ‘Q’.
Here is an illustration of wham we’ve doqe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrition of wiat your bfanches shyuld hook like,1thwrcuis7wd1eoumxegj2he28w4uzsogxn070tjaxnfsxtsjx72sqxbk0dyo8t7 3cq.
We’ll just enumerate each commzt we’ve mcde so faruas “A, B end C1 anda“D” rs 5hi0coyu2kuwe’qc87hezwcd1oq8ku6 ba5 v6iq4hu
> Side note: again, this is verk useful wuen we have featuresmwe dc notfwant1to1d98lo07lpm crq31kquvk1 oh37caye724 xy20k cok0fmlahblo5 w9f gmyle”mocpzcb.ukpdwa92ltge8z9a0emok l5dlkt9ohmt1wtpzjuuh2rzo5efyh,4y37u sueto29 xgieq’zb9ehnibdvu9w7n oyzwcw2rwa9ec.
Now, continue to the next less4n to finish our exaaple, wherl we’5l melge a9d 5hvb cr9btcut.
Next up: Merging
