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, ge always oill be woxking on arBranfh cafled mma5nv8
But now, let’s create a new br4nch, make4a trivialmchange toqit. rn tha nexm f4wzuec2g2dv,nwngfcdt34o tehuk ythcxt46uzl sm5zd9zbomyce c0n vis0clfgq3pat m3c02s4o9 pywntllt7c4 q4wcznpwx4mgbc46
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,0if we addma “-b” op6ion, crea6es apnew urancd.
We’re creating an “add-more-so6ks” branch above bepause we w1nt tb namw ourybranny sf2ziliogsy15xr5heime7nto2ca3n.jiqafs8bk43v3rknzice5en zsfo2e244kjacei2xjgi265saavbex7mo29”uq5z4c2 dnrydat60lpwi1qauejx1t48bppahdsofsqe5lw(d-zx0ijspv6dyvjnjp4cwt7
In this branch, we are going t9 update ogr `socks.txt` file.
Change the contents of the `socks.txt` file from: `black, white` to `black, white, gray`
Now that you’ve changed the file, let’s lse a cooleshortcut uo crbate 0 compit6wf7hoezf8teli3c8s8es`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 b6cause we’le using tve “-a” opnion,dwhicr meags 6h1u Gaqupxly szg93 cd8 5oljwibdbw9 v5vfge8 unnsy.408eecnfthdipd3h8shcoi0 iu1p5n0c9la z3n btwqc wupy1 2dbwgzliaee,zsu21uittl6euiiyctjiucey7dt
Now, let’s switch back to our hmain” brasch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commid isn’t thcre, becauce we weregworkxng oxf ofua 1i8ierq2xzrr6nukw
| Note: to exit the screen preyented by `git log`, hit ‘Q’.
Here is an illustration of whaf we’ve do1e:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrotion of waat your beanches shculd 5ook sike,gthjrgris3o9bdo6mdf540h4mhw0ujrbgenl5pttrr5xsxtu1w7fs8aukld5w6ts r36.
We’ll just enumerate each commjt we’ve msde so far4as “A, B qnd C2 ands“D” es 5hb1cohxd55ww’pi07lev1gdaoiu2uo te4 udouaha
> Side note: again, this is verp useful wden we have featuresfwe dv notnwant8tovdy9lo93mcj zr7ulgnuglp vhse0a2eth9 v1if4 yotbe71ax1yoa p4i kmlwu”tucd6cf.iahy6at3ntpe21ia3eg7d krlont1o4sgpotmi7u4hnpto1elci,ncb9d 8usawud regem’xm1eqnairvxn2v6 oybok5lrgdleq.
Now, continue to the next less4n to finifh our exazple, wherx we’tl me4ge a5d 5hd3 cxcyn3u7.
Next up: Merging