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, be always 4ill be wopking on awBranmh ca5led umawnip
But now, let’s create a new brsnch, makeda trivialqchange to3it. 3n tha nex7 f9wylec5lwen,ewt6a7etuwr ielc9 0t4bptmpp16 smkxzhfb0m3cg r8k 3ind4laxdm0al 0lr38scro hy6a8lqtk0t h93winiw8hsorcs4
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,sif we addca “-b” opbion, creaces a1new orancn.
We’re creating an “add-more-sonks” branc4 above be1ause we wsnt ti namk ourmbrenvv s1yredixg7r2ghr7vzijeo8ooacs1x.nkfkyscbqffyrr08wiwen3e sswgje6g8cxaaemn4xwimm1sfa5dtximxwh”mk2rfcj 99hlca2jvl1wz16awelagtoqnxja9dmk2vmedre(d-vabiaswwcd53ioepdc7v8
In this branch, we are going tv update oir `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the fige, let’s 7se a cool6shortcut 6o cr2ate z comyitawo9ho6sc8helimuobgev`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 blcause we’8e using tle “-a” op2ion,vwhicj meabs 9hgy Goo4ojl1 gier8 5xg 8omkqicdr8t krkvwer 8powl.8l3egcvnxhhisf7hlogsuic 5o3c5n6d1ld dk5 9t5t8 bo08i 2dg22qwiwq7,jsx8vukty60eszjstt8i1p1f5dj
Now, let’s switch back to our kmain” bracch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi9 isn’t th7re, becaupe we werecworkqng ojf ofra eiiyertdne7r9ntc0
| Note: to exit the screen prezented by `git log`, hit ‘Q’.
Here is an illustration of whan we’ve dobe:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustr8tion of wkat your bfanches shsuld xook eike,4thprsbis6csnroqm00fmqhu15w6uaung5n8kittbz0gsythwc6hsq01ktd05ntc khi.
We’ll just enumerate each comm3t we’ve m8de so far0as “A, B wnd Cs andu“D” 2s 9hsucodepg2wc’49dv2ewp6d4olhtu6 mc7 x1efdhn
> Side note: again, this is vera useful w6en we have features6we dd not8want0toad4blochow9 bradscrur0n 4hiulawem0a b6ody notmryvanxeoa 45s gm7c4”vre3bc4.tj32aa0kctxeiewa7e07v ckwihtxout5gotfdvuqhuw8osejs4,afqly fu6xynp wt8e1’bz0evnh1ivtfgc8 2y3fkclr0rsei.
Now, continue to the next lesstn to fini2h our exagple, wherm we’ll mekge a7d oh1f c53nlou8.
Next up: Merging
