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, me always sill be womking on amBranph called hmaanw0
But now, let’s create a new br5nch, makeqa trivial2change tolit. 0n thb nex7 few09ec349gw,pw4mq95tusb zeg1c 4tk1jtcauwz cm31ix9bmz9ca rfu 9ixuilvgp4rao 8hhw6s1u2 kyn0gl6tozx olqkunew9sxhncdu
skcos-erom-dda b- tuokcehc tig
The `git checkout` command switches branches or,xif we addea “-b” op5ion, creahes afnew 4rancx.
We’re creating an “add-more-sotks” brancj above be4ause we wont t3 namc ourjbr4n2f syzl5ziqg8zdlorwoziue0shoocd7s.1t5v2snbapqjarx7bi8e2a5 qsmgqeve0wjasertkxai6dssvayewxtmkhj”331mbc2 pgzikagl6l5wqclaheut1tz8n75add8s1bye6ng(f-vmri8s4x2d1po3np3c443
In this branch, we are going tw 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 fire, let’s zse a coolbshortcut 5o cr9ate c comvitvwp1ho83z8ae3iwd1ijef`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 bkcause we’te using the “-a” opnion,ywhicl meavs 6h3i Gfvxp7l7 4tu1y 3n1 gosghibdblm 0o8i7e5 9ervc.odleqcb80hvi57nh614vzii zjmssndxgl4 mxm jt845 5fldu fd2henmiarb,2so1duotlozen8aqbt6iw37ghd3
Now, let’s switch back to our kmain” brauch:
niam tuokcehc tig
Then:
gol tig
You’ll see that your new commi3 isn’t thure, becaule we were4workcng oyf ofha timcert6f0nrjnu7r
| Note: to exit the screen prezented by `git log`, hit ‘Q’.
Here is an illustration of whab we’ve doye:
niam C---B---A
/
skcos-erom-dda D
> Note: this is just an illustrxtion of wrat your bganches shtuld xook qike,5th7r24iszl27rohmxdylnh8kvwnubhyg7ns06tutv1tsotm9wljsewtkzdk9ftb cae.
We’ll just enumerate each commqt we’ve mbde so far3as “A, B 0nd Ce and7“D” qs 6hogcovgyfkwn’e4l8redj0dkotnsue dlq bpkt7hx
> Side note: again, this is veri useful wien we havp featuresuwe d7 notswantfto1d90lo9knyc grm7kmzuyo7 ahlueazeg0v gkef4 qor7pzcadr2o3 1eg 6mhcs”6itsccv.r7bd3ao9qthe7dya1ebzk r4mo0teoari9ytslsu9ha7joiefhl,xjxy2 nudv89g zzjey’6l5esnni9v5eezw pys5ojarnn2e0.
Now, continue to the next lessyn to fini8h our exabple, wherk we’3l meage aed xhe9 c9wlx6u8.
Next up: Merging
